[first i would like to apologize for making so many topics an soon after answering them myself]
So, i have a submit button that submits a form, the page it action=""'s to checks what button was pressed and does said function. the problem is, i need to run a validate() (JS) function when the button is pressed and only submit if the function returns successful.
if i put:
Code:
<input type="submit" name="signup" value="signup" onClick="validate()"/>
validate will run BUT the form will also be submitted anyways.
if i put:
Code:
<input type="button" name="signup" value="signup" onClick="validate()"/>
[p.s. "document.formname.submit();" is in the JS function]
in this case validate() will work and submit the form, BUT the
action page does not see the button name eg. "if ($_POST["signup"] == 'signup')"
________
Vaporizer