Watch Our YouTube Channel
It is currently Sat Dec 16, 2017 5:13 am

All times are UTC

Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Tue Oct 01, 2013 12:22 pm 

Joined: Tue Jan 29, 2013 10:24 am
Posts: 145
Location: India
If we are having two select boxes, We need to change the value of one select box according to the selection of another select box.

Find below code to do the above changes.

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<script language="javascript" type="text/javascript">
 /*function for changing age when changing the name
 function setage()
 /*function for changing name when changing the age.
 function setname()
  var index_age=document.frmselect.age.selectedIndex;;


<form name="frmselect" id="frmselect" action="" method="post">
 <select name="name" id="name" onChange="setage()">
  <option value="" selected>Select Name</option>
  <option value="1">Name1</option>
  <option value="2">Name2</option>
 <select name="age" id="age" onChange="javascript:return setname();">
  <option value="" selected>Select Age</option>
  <option value="a">Age1</option>
  <option value="b">Age2</option>

select.jpg [ 15.17 KiB | Viewed 898 times ]

K.Suresh Kumar
Motivational Quotes | Web Development | Software Testing

Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC

Who is online

Users browsing this forum: No registered users and 1 guest

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 post attachments in this forum

Search for:
Jump to: