Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > radio button

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-14-04, 00:15
fisya fisya is offline
Registered User
 
Join Date: Mar 2004
Posts: 53
radio button

hi everybody...
i have problem with radio button
in my page i have 2 radio button where one will be label as Aduan staff and enother one will be label as Aduan student. below the radio button there will be a textfield. if they click on the Aduan staff button, automatically the textfield will be written with Aduan staff but if they click on Aduan student the textfield will be empty. i have try some coding but it cannot work.can somebody tell me how to do this..pleaseee
Reply With Quote
  #2 (permalink)  
Old 06-14-04, 04:33
Madhivanan Madhivanan is offline
Registered User
 
Join Date: Oct 2003
Posts: 357
radio button

Hai fisya, try the following

<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>
</HEAD>
<BODY>
<script language="JavaScript">
function addtext()
{
if (document.test.name(0).checked==1)
{
document.test.Tname.value ="Aduan Staff";
}
else if (document.test.name(1).checked==1)
{
document.test.Tname.value ="";

}

}

</script>
<form name="test">
<input type=radio name="name" value="Aduan Staff" onclick="addtext()">Aduan Staff
<input type=radio name="name" value="Aduan Student" onclick="addtext()">Aduan Student<p>
<input type=text name="Tname">
</form>
</BODY>
</HTML>


Madhivanan
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On