Linking Form Objects in HTML to other Form Objects using VBScript 
Author Message
 Linking Form Objects in HTML to other Form Objects using VBScript

I have two Radio Button that use the same name therefore they can only
choose one or the other.

If the user clicks Button 1,  I want it to go to option box 1,  and if the
user clicks Button 2 then I want the next step to be option box 2.

If Button 1 is clicked then, option box 1 is a valid step, and option box 2
is invalid and cant be used.  Same for the opposite.

I tried to make this clear, but if I didn't just post a "don't understand"
or something.

I think all I need is one certain event handler and some sort of  "If"
"Then"  statement, but I am not sure.

Please Help.

Ben



Sat, 01 Jun 2002 03:00:00 GMT  
 Linking Form Objects in HTML to other Form Objects using VBScript

<HTML>
<HEAD>
<script language=VBScript>
sub btn_onclick()
  for each r in rad
    if r.checked then
      choice = r.value
      exit for
    end if
  next
  msgbox choice
end sub
</script>
</HEAD>

<BODY>
<input name=rad type=radio value=1 checked>Option 1<br>
<input name=rad type=radio value=2        >Option 2<br>
<input name=rad type=radio value=3        >Option 3<br>
<input name=rad type=radio value=4        >Option 4<br>
<input name=rad type=radio value=5        >Option 5<br>
<input name=btn type=button value="Do it..">

</BODY>
</HTML>

--
Michael Harris

  I have two Radio Button that use the same name therefore they can only
  choose one or the other.

  If the user clicks Button 1,  I want it to go to option box 1,  and if the
  user clicks Button 2 then I want the next step to be option box 2.

  If Button 1 is clicked then, option box 1 is a valid step, and option box 2
  is invalid and cant be used.  Same for the opposite.

  I tried to make this clear, but if I didn't just post a "don't understand"
  or something.

  I think all I need is one certain event handler and some sort of  "If"
  "Then"  statement, but I am not sure.

  Please Help.

  Ben



Sat, 01 Jun 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. VBSCRIPT - Set the value of form object before form posting

2. Open form, close form, open form = disposed object exception

3. HTML form object model questions

4. getting Element Index for an HTML form object

5. HTML form object model questions

6. Update parent form objects from child form data

7. Linked Objects in Windows forms!

8. WebBrowser Document object HTML form references question.

9. Resize forms based on HTML objects

10. Resize forms based on HTML objects

11. How to populate form using Wscript.Network Object

12. HOw to call objects from others Lib in VBscript

 

 
Powered by phpBB® Forum Software