HTML Tutorial


 Forum HomeForum Home   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
radiobutton activate dropdown and textbox
Post new topic   Reply to topic    HTML Help Forum Index -> HTML Form
View previous topic :: View next topic  
Author Message
raninda



Joined: 10 Apr 2008
Posts: 9

PostPosted: Wed Apr 23, 2008 4:20 pm     radiobutton activate dropdown and textbox Reply with quote

i'm so new here. and i'm so confuse right now.
i have a code like this

Code:

<table >
<tr><td><input type="radio" name="cari" value="all"> All</td>
<td><input type="radio" name="cari" value="tahun"> Tahun</td>
<td>
[b]<select name="tahun" disabled="disabled" >[/b]<option>SD</option>
<option>SMP</option>
<option>SMU</option>
<option>ATS</option>
</select>&nbsp;&nbsp;&nbsp;&nbsp;
[b]<input type="text" size="4" maxlength="4" name="ats" value="yyyy" disabled="disabled">[/b]</td></tr>
</table>


the bold line is set default to disabled. i try to make the dropdown and the textbox active when the radiobutton click.
please help...
Straystudio



Joined: 14 Apr 2008
Posts: 92
Location: Nord Italy

PostPosted: Wed Apr 23, 2008 7:58 pm     Reply with quote

 
You have done enough by yourself !
It will be a pleasure for me; and a good refresh, too.

Try this to start; We'll stay in touch.
Since NAME already arises with the Elements beeing in play, well I use document.getElementsByName("")[i] to make the machine able to individuate the Element to get a Value changed; the Value of DISABLED Attribute.


<table><tr>

 <td>
 <input onClick='javascript: document.getElementsByName("tahun")[0].disabled=""; document.getElementsByName("ats")[0].disabled="";' type="radio" name="cari" value="all"></input> All</td>
 <td>
 <input onClick='javascript: document.getElementsByName("tahun")[0].disabled=""; document.getElementsByName("ats")[0].disabled="";' type="radio" name="cari" value="tahun"></input> Tahun</td>
 <td>
 <select name="tahun" disabled="disabled" >
  <option>SD</option>
  <option>SMP</option>
  <option>SMU</option>
  <option>ATS</option>
 </select>
&nbsp;&nbsp;&nbsp;&nbsp;
 <input type="text" size="4" maxlength="4" name="ats" value="yyyy" disabled="disabled"></input>
 </td>

</tr>
</table>



Wishes from Italy
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> HTML Form All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
 
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial