Forum Moderators: open
I have two forms.
<form name="one" id="one" method="post">
<input name="" type="submit">
</form>
<form name="Mone" onsubmit="return fun()">
<input name="" type="submit">
</form>
When i click submit the second form ---> it should submit the first one.
function fun(){
document.forms[0].submit();
document.forms[0].onsubmit = function()
{
alert('sdfdsfs');
return false;
}
return false;
}
But i don't know what is wrong here. I am not getting the alert...
Can anyone help me with this..?
Any help is really appreciated.
Thanks
try it like this...
***********************************************************
<script type="text/javascript">
function fun(){
document.forms[0].submit();
alert('sdfdsfs');
return false;
}
</script>***********************************************************
<form name="one" id="one" method="post" action="http://www.example.com">
<input name="" type="submit">
</form><form name="Mone" onsubmit="return fun()" action="#">
<input name="" type="submit">
</form>***********************************************************