Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Apr 2009
    Location
    Russia
    Posts
    20
    Thanks
    3
    Thanked 0 Times in 0 Posts

    PLease Help with Java !!!

    solved thanks
    Last edited by kingh; 05-06-2009 at 12:19 AM.

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,022
    Thanks
    203
    Thanked 2,538 Times in 2,516 Posts
    Sorry, I do not have a clue what you are talking about.

    Please post your complete HTML code for the form and try to explain more clearly what your problem is.

    You should note that Java and Javascript are entirely different programming languages, in spite of the confusingly similar names.

  • #3
    New Coder
    Join Date
    Apr 2009
    Location
    Russia
    Posts
    20
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Here

    solved thanks
    Last edited by kingh; 05-06-2009 at 12:19 AM.

  • #4
    Regular Coder
    Join Date
    Mar 2009
    Location
    Portland Oregon
    Posts
    690
    Thanks
    44
    Thanked 63 Times in 62 Posts
    missing } and one] should be }


    switchaction(){if document.getElementById("skilled").style.display="block"} else {skilled.php }


    try this
    I have not tested, but these are simple corrections
    Last edited by TinyScript; 05-05-2009 at 09:03 PM.

  • #5
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,022
    Thanks
    203
    Thanked 2,538 Times in 2,516 Posts
    Try (and adapt) this:-

    Code:
    <form name="myform" onSubmit="return OnSubmitForm();">
    Skilled Worker <input type = "radio" name = "rad1" id = "rad1" value = "skilled">
    Business Class <input type = "radio" name = "rad1" id = "rad1" value = "business">
    Family Sponsorship <input type = "radio" name = "rad1" id = "rad1"value = "family"> 
    Experience Class <input type = "radio" name = "rad1" id = "rad1" value = "experience"><br><br>
    
    <input type = "submit" name = "submitButton" value = "Submit">
    </form>
    
    <script type = "text/javascript">
    
    function OnSubmitForm() {
    
    for (var i=0; i<document.myform.rad1.length; i++) {
    if (document.myform.rad1[i].checked) {
    var x = document.myform.rad1[i].value;
    }
    }
    if (x==undefined) {
    alert ("Please select a category");
    return false;
    }
    var newAction = "http://website.com/" + x + ".php"; 
    alert (newAction);  // delete after testing
    document.myform.action = newAction;
    return true;
    
    }
    </script>

    Overheard in Italy: "The Tower of Pisa - is it actually in Pisa?"

  • Users who have thanked Philip M for this post:

    kingh (05-06-2009)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •