If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-13-04, 23: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, 03: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

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