> -----Message d'origine-----
> De : R Kumar [mailto:aptrb2003@y...]
> Envoy=C3=A9 : samedi 25 janvier 2003 04:54
> =C3=80 : javascript
> Objet : [javascript] Submit form problem
>
>
>
> Dear Friends,
> Hello all. I am facing the following problem.
>
> On a single htm page, i have two forms namely "part1" and "part2".
> The code is as follows:
>
> <HTML>
>
> <HEAD>
>
> <META NAME=3D"GENERATOR" Content=3D"Microsoft Visual Studio 6.0">
>
> <script language=3D"JavaScript">
>
> function getResult(form)
> {
> document.part2.submit(form);
Is this line generated by MSVS 6.0? It should be
document.forms[form].submit()
> document.part1.getresult.value =3D "BACK"
But I doubt this second line would be executed because the form
values are sent and thus the page is refreshed.
> }
>
> </script>
>
> </HEAD>
>
> <BODY>
>
> <form name=3D"part1">
>
> <p> <input type=3D"button" name=3D"getresult" value=3D"GET RESULT"
> onClick=3D"getResult(part2)"></p>
>
> </form>
>
> <form name=3D"part2" action=3D"result.asp" method=3D"post">
>
> <p> <input type=3D"text" name=3D"states"> </p>
>
> </form>
>
> </BODY>
>
> </HTML>
>
> Now, when i click the GET RESULT button, only the its value
> is changed and such the part2 form
> is not submitted.
>
> What is the reason?
Explained above.
> Secondly, when the cursor is in the textbox and i press
> "ENTER" , the control is passed
> to the asp page and result is obtained. I want to capture
> this "ENTER" key press and avoid
> transfer to the asp page. How is that possible?
There was a thread recently about this in this list. Make a search
of it.
> eager to know the solution.
>
> bye,
> ritesh
>
>
> Catch all the cricket action. Download Yahoo! Score tracker
>
>