I have a jQuery form wizard which I plugged to my website. What I am trying to do here is when the user reach the end point of the form, an alert in JavaScript popup to him. I tried this very simple JavaScript code at the top of my page <head>..some code</head>
function alertme() {
if (this.value = "Submit") {
alert("welcome");
}
else {
return false;
}
}
the HTML button that I am trying to run this function when the event OnClick() happen
<input class="navigation_button" id="next" value="Next" type="submit" onclick="alertme();" />
as you see the value now is Next, the problem here is my JavaScript function ignore the value and popup the alert whenever the button has been click during the form steps, how should I solve this problem?
1 Answer