More Help Required if possible - Javascript Related.

Discussion in 'JavaScript' started by RazorianFly, Apr 16, 2007.

  1. #1
    Ok, I have another problem I hope you lot can help me with.

    I have a script as follows:

    It's a validation script I pieced together with bits from various websites. It basically botches out the submit button until the agree tickbox is ticked by the user.

    What my query is, is how to I encorporate a "Href" link redirect into the submit button? So that, in this case, the user is redirected to the message board url whe the submit button is clicked after agreeing to the terms.
    Is it possible?

    Thanks in advance to any responce,
    R-Fly
     
    RazorianFly, Apr 16, 2007 IP
  2. krakjoe

    krakjoe Well-Known Member

    Messages:
    1,795
    Likes Received:
    141
    Best Answers:
    0
    Trophy Points:
    135
    #2
    
    <SCRIPT TYPE='text/javascript'>
    function switchbutton() {
    
    if (document.myform.btnSubmit.disabled) {
    document.myform.btnSubmit.disabled = false;}
    else {
    document.myform.btnSubmit.disabled = true;}
    
    return true;
    
    }
    
    </SCRIPT>
    
    <form method="post" action="" onSubmit="document.location.href='http://yourlocation.com'; return false;" name="myform">
    
    Agree? <input type="checkbox" onClick="return switchbutton();">
    
    <input type="submit" name="btnSubmit" disabled>
    
    </form>
    
    HTML:
    <form method="post" action="" onSubmit="document.location.href='http://yourlocation.com'; return false;" name="myform">
     
    krakjoe, Apr 17, 2007 IP