js alert box query

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • saranya prabaka
    New Member
    • May 2011
    • 1

    #1

    js alert box query

    this is my on click function:

    Code:
    <html:submit styleClass="button" property="orderBtn" onclick="payTypeValidation(this.form);"
    in java script im having:

    Code:
    function payTypeValidation(form)
    {
    alert( "payment type and button value miss match, stop here");
    			return false;
    }
    when i click ok which will come in alert, I want to stay in the same page, so gave return false in js.

    But this is not happening, so please give alternate ideas.
    Last edited by acoder; May 12 '11, 11:42 AM. Reason: Please use [code] tags
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Use return:

    Code:
        <html:submit styleClass="button" property="orderBtn" onclick="[b]return[/b] payTypeValidation(this.form);">

    Comment

    Working...