![]() | | ||||||||
| | #1 |
| Warrior Member Join Date: Sep 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
I'm struggling with a problem with makeing my old form work with Javascript. Here is the old form that works with our CGI script: Code: <form method="POST" enctype="application/x-www-form-urlencoded"> .... a series of fields.... <input type="submit" name="save_meeting_msg" value=" Update "> Code:
<form id="ContactForm" method="POST" enctype="application/x-www-form-urlencoded">
.... a series of fields....
<a href="#" class="link2" name="save_meeting_msg" onclick="document.getElementById('ContactForm').submit()"><strong><strong>Send</strong></strong></a> I've looked everywhere and can't seem to find how to use the submit() to pass along the 'name' value in Javascript. Your help is greatly appreciated. |
| | |
| | #2 |
| Banned War Room Member Join Date: May 2009
Posts: 33
Thanks: 5
Thanked 1 Time in 1 Post
|
You can't send form data through an a tag. If you want to send the 'save_meeting_msg' variable/name along with a value then you should create a hidden input field and do it that way. Hope that makes sense. |
| | |
| | #3 |
| Active Warrior War Room Member Join Date: May 2009 Location: Vancouver, British Columbia, Canada
Posts: 95
Thanks: 7
Thanked 8 Times in 7 Posts
|
You're better off using a server side form script. I'd suggest using a PHP script like formtoemail. They have a pro version as well.
|
| | |
| | |
| | #4 |
| Senior Warrior Member War Room Member Join Date: Sep 2008 Location: Honolulu, Hawaii, USA & Montreal Canada
Posts: 2,218
Blog Entries: 1 Thanks: 759
Thanked 724 Times in 505 Posts
|
Robert is correct, the easiest way of doing this is with a hidden text box holding your 'save_meeting_msg' variable. Maybe it's complicating things to much but now that you have a "fancy JavaScript form" have you considered submitting the form values via AJAX (i.e. using the XMLHTTP method)? You could pass as many variables as you want as a JSON or XML string. If you use JSON it's really easy to work with the data directly with JavaScript and PHP 5. Just a thought, best of luck with your project. Bill |
| | |
![]() |
|
| Tags |
| forms, javascript, submit |
| Thread Tools | |
| |
![]() |