Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 5 of 5
  1. #1
    Senior Member Kings's Avatar
    Join Date
    Feb 2002
    Posts
    129
    Member #
    19
    I have the following function to set the value of radio buttons, but it's not working. Can you see what's wrong with it? Thanks!
    Code:
    function setcheckboxvalue(checklist, tocheckfor) {
    	// Create checkbox object
    	var checkbox = document.getElementById(checklist);
    
    	// Loop through each option
    	for (var i = 0; i < checkbox.length; i++) {
    		// Check if the value is the same, if so, check it
    		if (checkbox[i].value == tocheckfor) {
    			checkbox[i].click();
    			break;
    		}
    	}
    }
    K i n g s

    Several handy ASP Resources:
    4guysfromrolla | aspin | ASP101 | AspIt | learnasp

    Several handy ASP.NET resources:
    ASP.NET | .NET Experts | O'Reilly .NET | AspIt | 4guysfromrolla

    Several paid ASP/ASP.NET webhosts:
    Brinkster | Maximum ASP | Clicktech | Nodehosting | Uplinkearth | Webhost4life

  2.  

  3. #2
    Guest
    I found these threads that look to be similar to yours. Do any of them help?



    If they don't a human will be along soon anyway to help you out more.

  4. #3
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    What's the function supposed to do? Check a bunch of checkboxes at once?
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  5. #4
    Senior Member Kings's Avatar
    Join Date
    Feb 2002
    Posts
    129
    Member #
    19
    It's supposed to set the value of a radiobutton, e.g
    Code:
    <input type="radio" name="test" value="yes">
    <input type="radio" name="test" value="no">
    
    <script language="JavaScript">
    <!--
    setcheckboxvalue('test', 'no');
    -->
    </script>
    After running that, the no radiobutton would be checked/selected.
    K i n g s

    Several handy ASP Resources:
    4guysfromrolla | aspin | ASP101 | AspIt | learnasp

    Several handy ASP.NET resources:
    ASP.NET | .NET Experts | O'Reilly .NET | AspIt | 4guysfromrolla

    Several paid ASP/ASP.NET webhosts:
    Brinkster | Maximum ASP | Clicktech | Nodehosting | Uplinkearth | Webhost4life

  6. #5
    Senior Member Kings's Avatar
    Join Date
    Feb 2002
    Posts
    129
    Member #
    19
    Nevermind, I got it working finally. (btw, that function is useless.)
    K i n g s

    Several handy ASP Resources:
    4guysfromrolla | aspin | ASP101 | AspIt | learnasp

    Several handy ASP.NET resources:
    ASP.NET | .NET Experts | O'Reilly .NET | AspIt | 4guysfromrolla

    Several paid ASP/ASP.NET webhosts:
    Brinkster | Maximum ASP | Clicktech | Nodehosting | Uplinkearth | Webhost4life


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 09:46 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com