submit a form with javascript
hello,
i have a question about javascript. I want a user to click on a button which brings up a new window. That part is easy, i know how to implement that, but my trouble is in the new window i want to be able to make a form and be able to submit that form to either a database or another link. is this possible with javascript????? let me know it this isn't clear enough thanks, djgerbavor3 |
Yes. You just need to execute "document.FORM_NAME.submit()" when you want the data to be submitted.
|
i'm alittle confuse.
how would i do that. i have a funtion that pops ups a new window were the form is going to be. Code:
function form_window() { thanks, djgerbavor3 |
If your form actually has a submit button then you don't need to use javascript to submit it. Just set the action variable in the form to be the page you are taken to - ie:
<form action="myscript.php"> |
okay here is what i have:
Code:
function form_window() { thanks for you time, djgerbavor3 |
My only guess is that the submit button is not being written within the form - try using:
newWin.document.write("<input type=\"submit\" value=\"Submit Form\">"); newWin.document.write("</form>"); |
hahah that worked!!!!!!!!!!! i can't believe i didn't know that :) oh well you learn something new every day. Thanks for you help.
djgerbavor3 |
All times are GMT -5. The time now is 02:51 AM. |