| | |
javascript form help
Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Apr 2007
Posts: 33
Reputation:
Solved Threads: 0
hi there,
i have a problem resetting my form with javascript. I have a registration form that when submitted, the action is performed in an iframe so that the browser does not have to load another page. After form validation, i want the php script in the iframe to clear all fields of the form in the parent document. i have tried all ways like:
i have tried everything from giving the form an ID and using But i still cannot reset the form. What can i do. Please help. Thanks alot.
i have a problem resetting my form with javascript. I have a registration form that when submitted, the action is performed in an iframe so that the browser does not have to load another page. After form validation, i want the php script in the iframe to clear all fields of the form in the parent document. i have tried all ways like:
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
$insert_sql = mysql_query("INSERT INTO ...... "); if($insert_sql){ ?> <script> alert("Query Successful"); parent.document.forms[0].reset(); </script> <?php }else{ ?> <script> alert("<?php mysql_error($conn); ?>"); </script> <?php }
i have tried everything from giving the form an ID and using
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
document.getElementById('form').reset();
baba
•
•
•
•
hi there,
i have a problem resetting my form with javascript. I have a registration form that when submitted, the action is performed in an iframe so that the browser does not have to load another page. After form validation, i want the php script in the iframe to clear all fields of the form in the parent document. i have tried all ways like:
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
$insert_sql = mysql_query("INSERT INTO ...... "); if($insert_sql){ ?> <script> alert("Query Successful"); parent.document.forms[0].reset(); </script> <?php }else{ ?> <script> alert("<?php mysql_error($conn); ?>"); </script> <?php }
i have tried everything from giving the form an ID and usingBut i still cannot reset the form. What can i do. Please help. Thanks alot.JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
document.getElementById('form').reset();
Its difficult to figure out the problem without viewing the code of the while form.
Just a guess:
May be in the your fields have been assigned value after the form reset.
for example
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
$insert_sql = mysql_query("INSERT INTO ...... "); if($insert_sql){ ?> <script> alert("Query Successful"); parent.document.forms[0].reset(); //here you are resetting the form ........................ ........................ </script> <?php } <form action=...> <input name="appName" value = "<?php echo $appName; ?>" > <!-- here again values are assigned -->
I guess this may be the problem ... because the code in the page is normally processed top to bottom .. the form has been reset but the values are again assigned.
If it doesnot solve your problem, please provide the whole code.
Regards ...
IF SOMEONE FEELS THAT THEY HAD NEVER MADE A MISTAKE IN THEIR LIFE, THEN IT MEANS THEY HAD NEVER TRIED A NEW THING IN THEIR LIFE
![]() |
Similar Threads
- Need help with Javascript (JavaScript / DHTML / AJAX)
- Javascript form managment on the fly! (JavaScript / DHTML / AJAX)
- How to make javascript form autochange - "Onchange"? (JavaScript / DHTML / AJAX)
- Javascript, Form fields validation and submit (JavaScript / DHTML / AJAX)
- Form not sending email (PHP)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: Please help me
- Next Thread: deleting sessions on closing browser tab
| Thread Tools | Search this Thread |
ajax ajaxcode ajaxhelp ajaxjspservlets animate automatically beta box browser bug calendar captchaformproblem checkbox child class close column cookies createrange() css cursor dependent disablefirebug dom download dropdown editor element engine error events explorer ext file form forms google gwt gxt hiddenvalue highlightedword html htmlform ie8 iframe image() images internet java javascript jawascriptruntimeerror jquery jsf jsfile jump libcurl math media microsoft mimic object onerror onmouseoutdivproblem onreadystatechange parent pdf php player post problem progressbar rated rating regex runtime scroll search security select session shopping size software sql star stars synchronous text textarea unicode validation w3c web website window windowofwords windowsxp wysiwyg xml \n





