Form submit problem using javascript

software development

#1

hi 2 all,
my problem is:
i used below form,

--------------------------------------------------------- it has no action. i programmed using javascript in a way that it determines dynamically the action. here are the javascript ------------------------------------------------- function validation() { if(!(document.checkfrm.domain.value)) { document.checkfrm.action = "index.php"; return false; } else { document.checkfrm.action = "results.php"; return true; } } function enter() { if(window.event.keyCode == 13) { document.forms[0].action = "results.php"; document.forms[0].submit(); } } ------------------------------------- when i press button, it works fine but i want to submit the form when anyone type something in text box and when press enter. at that time form is submited but the value of the textbox and button are not submitted. results.php file opens but does not show the php code. it shows well when i submit form using button.

i used both, forms[0] and form name(‘checkfrm’) in javascript. but not worked in IE.

it works fine with the firefox browser but it fails in IE.

so anyone knows the remedy, then pls let me know

Thanks
-ENIL


#2

instead of an onclick in the button, use onsubmit to call your function. that should probably work.


Jonathan
http://fleshy.org.nz/yum/


#3

Thanks brink

but i did that too
and do not work

-ENIL