Place the code from the onClick of the image in the onSubmit of the
form.

<form name="newcall" id="newcall" action=""> method="get" return
false;">
...
   <input type="image" id="next_button"
name="next_button" src=""> border="0" alt="Next" , mouseaction_next);"
width="83px" height="27px"
style="z-index:100">

> -----Original Message-----
> From: cf coder [mailto:[EMAIL PROTECTED]
> Sent: donderdag 11 maart 2004 13:51
> To: CF-Talk
> Subject: how to submit a form by pressing enter - bit complicated!
>
> Hello Everybody,
>
> Can I just say that I've looked everywhere to find a solution
> to this problem and have failed.
>
> I am posting my code and would really appreciate if someone
> could help. I have two forms in my page each contained in a
> div tag. Actually the second form is called from a iframe
> from within a div tag. You will understand it after you've
> seen the code.
>
> <script language="_javascript_" type="text/_javascript_">
>
> <!--
>  function mouseaction_next()
>  {
>     if(document.newcall.cust_login.value != ""){
>           window.userdetailsIframe.location.href = ""> > "/pages/userdetails.cfm?userDetails="+document.newcall.cust_lo
> gin.value;
>       }
>  }
> -->
> </script>
>
> <form name="newcall" id="newcall" action=""> > method="get">
> <div id="div1" style="z-index:2; position:absolute;
> left:45px; top:27px; visibility:visible;">  <table>
>   <tr>
>    <td valign="middle">
>     Enter Login ID:
>    </td>
>    <td valign="middle">
>    <input id="cust_login" name="cust_login"
> type="text">
>    </td>
>    <td valign="bottom">&nbsp;&nbsp;&nbsp;
>    <input type="image" id="next_button"
> name="next_button" src=""> > border="0" alt="Next" ,
> mouseaction_next);" return
> false;" width="83px" height="27px"
> style="z-index:100">
>    </td>
>   </tr>
>  </table>
> </div>
> </form>
>
> <div id="div2" style="z-index:2; position:absolute;
> left:43px; top:105px; visibility:visible;">
>     <iframe allowtransparency="yes"
> id="userdetailsIframe" name="userdetailsIframe"
> width="670px" height="300px" frameborder="0"
> scrolling="no" src=""> > </div>
>
> Here is the code contained in the iframe
> (seaarchform.cfm)
>
> <form name="searchform" action=""> > method="post">
> <div id="search" style="z-index:2; position:absolute;
> left:0px; top:0px; visibility:visible;">  <table border="0">
>   <tr valign="bottom">
>    <td colspan="3" align="center">
>        <input type="text" name="number" id="number"
> size="30">
>    </td>
>   </tr>
>   <tr>
>     <td align="right" valign="top">
>      <input type="image" src=""> > border="0" name="search_button" id="search_button"
> alt="Search for calls">
>     </td>
>   </tr>
>  </table>
> </div>
> </form>
>
> Here is my problem. I input some text in the textfield
> contained in the form 'newcall' and hit the enter key.
> I expect the focus to switch to the image tag contained in
> the form 'next_button', which should then call the _javascript_
> function and redirect the user to userdetails.cfm. This does
> not happenn.
>
> However if I input some text in the textfield (number)
> contained within the second form (searchform) and hit the
> enter key, the focus switches to the #search_button' image
> button and I'm directed to the search results page.
>
> I don't know how to get round this problem and would really
> apprecaite if someone could help.
>
> Best Regards,
> cfcoder
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Search - Find what you're looking for faster
> http://search.yahoo.com
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to