Results 1 to 2 of 2

Thread: checkbox validation

  1. #1
    Join Date
    Jul 2008
    Location
    Banglore
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default checkbox validation

    hi,i have single checkbox and radio button with that iam genarating multiple checkboxes radio's.if both selected then only iam performing the import the seleted checkbox(topic-contains no of questions) topic into selected radio button topic(contains no of questions),if u not select any one it will say "please select radio/check box".

    Then ,i can select multiple checkboxes and only one radio button.if iselect multiple checkboxes(ex:-4 checkboxes) and radio button.all the selected(4) topics questions will be imported to selected radio button after clicking "import " button.


    My question is .after selecting 4 checkboxes,if i not select radio button.iam sending a error msg "please select radio buuton" but after displaying error message that check boxes are clearing(becoming unchecked ) but that should be checked .how can i do that,

    Please Help.................

    Thank You,
    Sreenu

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Can you please use correct grammar and spelling? I can't understand you a bit.
    Since I couldn't understand you, I've made a one examples for you. (Of what I thought you want)
    Radio Checkbox, changes inputs(this one is not in an html form, although its simple to make it into one. Its also, well I made it a phone number script, easy to change too).
    HTML Code:
    <script type="text/javascript">
    function changeRadio(el,cell){
    if(el.checked="yes"){
    document.getElementById('hidden').innerHTML=((cell)? 'Cell: ' : 'Home: ')+'<input type="text" />';
    } else {
    document.getElementById('hidden').innerHTML='';
    }
    }
    </script>
    <h2>Please fill in your phone data</h2>
    Home Phone: <input type="radio" onClick="changeRadio(this,false);" name="phone"/><br />
    Cell Phone: <input type="radio" onClick="changeRadio(this,true);" name="phone"/><br />
    <span id="hidden"></span>
    Last edited by Nile; 07-11-2008 at 07:41 PM.
    Jeremy | jfein.net

Bookmarks

Posting Permissions

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