Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Check for Radio Button's Presence

Status
Not open for further replies.

bont

Programmer
Sep 7, 2000
200
0
0
US
I have a situation on a form, where I do the following (pseudo code)

for k = 0 to 128 do
if eval(FormName & ".Radio_" & k) then
...
end if
end for

What I am trying to do is cycle from 0 to 128. IN doing so I have several radios on the html page that have the name with syntax:

FormName & ".Radio_" & k

When I alert the returned value, I receive a value of [object] when the button is found and "undefined" when it is not found. I want to exclude the "undefined" ones from the ... processes. What kind of coparison can I use for this, or is there a better way completely?
 
bont,

Can you provide us with your code?

Thanks,
Brian
 
NO I can't give show you the code. The basic setup is this:

For i = 0 to 128

/ I need some condition here to see if radio button with the sequence number of i is present on the page or not i.e. eval("radio_" + i + ".type").

The example I use here returns different values ("

...

/ End condition here



endfor;

 
You said that eval(FormName & ".Radio_" & k) returns [Object] or undefined so why not use

if(eval(FormName & ".Radio_" & k)!="undefined"){
...
}

Adam
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top