Javascript form Validation on Radio Button Help

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Javascript form Validation on Radio Button Help

    When I try to add the validation for if the 1st, 2nd, or 3rd radio button is selected the respective field is required, it is somehow making it required even when that field is not selected. For example, I select the first one and then the credit card details on the 2nd one are required.

    Form example:
    Order Check Out

    The javascript: http://nonvoiceprocess.net/cart_test/cartx.js

    If you can give me the script to add to the js file I'd really appreciate it. I gave my best and just couldn't get it.

    Thanks in advance.
    Last edited by johnwboyd; 21.03.12, 03:11.

    #2
    your nearly there.... heres a start to it:
    PHP Code:
    if(document.getElementById("m-p").checked && document.getElementById("m-p-1").value == "")
    {
       
    document.getElementById("selectx").focus();
            
    document.getElementById('selectx').style.display="block";
            return 
    false;

    Comment

    Working...
    X