Forum Moderators: open
I actually have in my html:
<input name="okbot" type="image" id="okbot"
onClick="MM_openBrWindow('loading.htm','oknews','width=380,height=133')"
src="img/okbot.gif" alt="Enviar" align="middle" width="20" height="14"
border="0" >
But that works if the user clicks the button, not if the user press "enter"
key.
Is there anyway to make the pop up confirmation window appear `b]wether they click or press enter[/b] after filling the email field?
onsubmitevent handler on the
<form>element and setup your own function for form submittal...
...
function checkForm(form, evt) {
if (do I want to submit the form?) {
return true
} else {
return false
}
...
<form action="process.php" method="post" onSubmit="return checkForm(this, event)">
I guess the first part should be in the head tag
and the rest in the submit.
the part: (form, evt) should say (form, event)
or must I replace that with any particular data?
I appreciate your help about it!
The
(this, event)on the
onsubmitevent handler of the <form> are javascript keywords.
thisrefers to the related element of the document, in this case the <form>.
eventwill grab the keyboard event, which you may or may not be concerned about. Both values get passed to the javascript function where they take on whatever variable names you have assigned in the functions parameter list, in this case
(form, evt)so that within the function you can refer to them by this variable name.