can someone check this small javascript validation please

Discussion in 'JavaScript' started by asim_nazir1, Mar 6, 2009.

  1. #1
     <script type="text/javascript">
    <!--
     currentURL = iframe.location.href;
    function validate_form ( )
    {
        valid = true;
       
    	
        if ( iframe.location.href; == "currentURL" )
        {
            alert ( "Please crop your image" );
            valid = false;
        }
    
        return valid;
    }
    
    //-->
    </script>
    Code (markup):
     <form action='http://www.romancart.com/cart.asp' method=post target=_parent onSubmit="return validate_form( );">
    Code (markup):
    Basically the before the order form submits it should check the too see if the iframe src has been changed.

    but its doesnt work and form just gets submitted,
    thanks
     
    asim_nazir1, Mar 6, 2009 IP
  2. xlcho

    xlcho Guest

    Messages:
    532
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #2
    change
        if ( iframe.location.href; == "currentURL" )
    Code (markup):
    to
        if ( iframe.location.href == currentURL )
    Code (markup):
     
    xlcho, Mar 6, 2009 IP