RE: [PHP] Submit form from javascript code
| From: | Todd Pasley | Date: | Sun, 01 Sep 2002 01:24:43 +0000 |
| Subject: | RE: [PHP] Submit form from javascript code | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-114804@lists.php.net to get a copy of this message | ||
Hi
Instead of
> retrun false;
im sure you meant
return false;
The reason its working with confirm and the like is because of their return
code.... which is actually true.
Try changing it to return true, im pretty sure that will fix it.
Cheers,
Todd.
> -----Original Message-----
> From: Madjid Nasiri [mailto:mnasiri@kawacomputer.com]
> Sent: Saturday, 31 August 2002 9:44 PM
> To: php-general@lists.php.net
> Subject: [PHP] Submit form from javascript code
>
>
> Hi all
> I need submit a form from javascript code. My code near this code:
>
> <!-- My Code -->
> <form name="myform" action="..." method="POST>
> <input type="hidden" name="id" value="0">
> </form>
> <script language="javascript">
> function submitform(iId)
> {
> document.myform.elements['id'].value=iId;
> document.myform.submit();
> alert("foo"); // This is code is dummy
> retrun false;
> }
> </script>
> <a href="..." onMouseDown="submitform(1);">Id One</a><br>
> <a href="..." onMouseDown="submitform(2);">Id Two</a><br>
> ....
> <a href="..." onMouseDown="submitform(1000);">Id
> 1000</a><br>
> <!-- End My Code -->
>
> If I remove alert() call in submitform function, this code noting
> work, but
> if i used alert() or confirm() function this code working, Why?
> How can i remove alert() function and my code work?
>
> Thanks for Answer
>
> Madjid Nasiri
> nasiri@kawacomputer.com
> http://www.kawacomputer.com
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>