Hi,
pls help me;
i wanna when forst time script run then all other text field should not be display and when select other then other text field display. i have written code this code when i
select first select other from first selection field this is displaying all other field but this is wrong. when i select one then one other field display and when slect ohter text field then display other text field. and when select other value rest of 'other' then other text field should be hide. below is my code:
Hi,
this is my javascript code:
//////////////////
- function display(obj,id1)
-
{
-
txt = obj.options[obj.selectedIndex].value;
-
document.getElementById(id1).style.display = 'none';
-
if ( txt.match(id1) )
-
{
-
document.getElementById(id1).style.display = 'block';
-
}
-
-
}
-
/////////////////////
And This is my original code of html:
//////////////////////////////////////////////////////////
{$script}
[HTML]<script>setTimeout("document.getElementById('statu s_message').innerHTML=' '",2000)</script>
<div align="center">
<fieldset class="formborder"><legend style=" color:#777;">Add Education Details</legend>
<div class="status_message" id="status_message"> {$smarty.session.status_ message}</div>
<!--<div align="center">
<div class="status_message">{$smarty.session.status_mes sage}</div>
<fieldset style="width:70%; border:1px solid #85C21C;"><legend style=" color:#777;">Add Education Details</legend>
<br/>-->
<table border="0">
<form id="add_education_details" name="add_education_details" method="post" action="index.php?page=Education&action=Create">
<tr>
<td colspan="2" align="left"><div class="heading">Education Details</div><br>
</td>
</tr>
<tr>
<td align="right">
<label for="cons_indi_edu_deg">Degree/Diploma
<span class="req">*</span></label>
</td>
<td align="left">
<select name="cons_indi_edu_deg" id="cons_indi_edu_deg" style="width:180px" class="text medium" onChange="return displayt(this,'other')">
<option value="select">select</option>
<option value="Not Pursuing Graduation" >Not Pursuing Graduation</option>
<option value="B.A" >B.A</option>
<option value="B.Arch" >B.Arch</option>
<option value="BCA" >BCA</option>
<option value="B.B.A" >B.B.A</option>
<option value="B.Com">B.Com</option>
<option value="B.Ed" >B.Ed</option>
<option value="BDS" >BDS</option>
<option value="BHM" >BHM</option>
<option value="B.Pharma" >B.Pharma</option>
<option value="B.Sc" >B.Sc</option>
<option value="B.Tech" >B.Tech/B.E.</option>
<option value="LLB" >LLB</option>
<option value="MBBS" >MBBS</option>
<option value="Diploma" >Diploma</option>
<option value="BVSC" >BVSC</option>
<option value="CA" >CA</option>
<option value="CS" >CS</option>
<option value="ICWA" >ICWA</option>
<option value="Integrated PG" >Integrated PG</option>
<option value="LLM" >LLM</option>
<option value="M.A" >M.A</option>
<option value="M.Arch" >M.Arch</option>
<option value="M.Com" >M.Com</option>
<option value="M.Ed" >M.Ed</option>
<option value="M.Pharma" >M.Pharma</option>
<option value="M.Sc" >M.Sc</option>
<option value="M.Tech" >M.Tech</option>
<option value="MBA/PGDM" >MBA/PGDM</option>
<option value="MCA" >MCA</option>
<option value="MS" >MS</option>
<option value="PG Diploma" >PG Diploma</option>
<option value="MVSC" >MVSC</option>
<option value="MCM" >MCM</option>
<option value="other" >other</option>
</select><span>
<label>
<input name="cons_indi_edu_odeg" id="other" type="text" style="display: none;width:180px" maxlength="25" class="text medium" />
</label></span>
</td>
</tr>
<br /><br />
<tr>
<td align="right">
<label for="cons_indi_edu_inst">Name of Institute
<span class="req">*</span></label>
</td>
<td align="left">
<select name="cons_indi_edu_inst" id="cons_indi_edu_inst" style="width:180px" class="text medium" onChange="return display(this,'other')">
<option value="select" >select</option>
<option value="inst1" >intst1</option>
<option value="inst2" >inst2</option>
<option value="inst3" >inst3</option>
<option value="inst4" >inst4</option>
<option value="inst5" >inst5</option>
<option value="other" >other</option>
</select><span>
<label>
<input name="cons_indi_edu_oinst" id="other" type="text" style="display: none;width:180px" maxlength="50" class="text medium"/>
</label></span>
</td>
</tr>
<tr>
<td align="right">
<label for="cons_indi_edu_exprtise">Specialisation
<span class="req">*</span></label>
</td>
<td align="left">
<input name="cons_indi_edu_exprtise" id="cons_indi_edu_exprtise" type="text" class="text medium" maxlength="100" style="width:170px" validation="urt_m" />
</td>
</tr>
<tr>
<td align="right">
<label for="month">Year of Graduation
<span class="req">*</span></label>
</td>
<td align="left">
<select name="month" id="month" style="width:75px;">
<option value="Month">Month</option>
<option value="Jan">Jan</option>
<option value="Feb">Feb</option>
<option value="Mar">Mar</option>
<option value="Apr">Apr</option>
<option value="May">May</option>
<option value="Jun">Jun</option>
<option value="Jul">Jul</option>
<option value="Aug">Aug</option>
<option value="Sep">Sep</option>
<option value="Oct">Oct</option>
<option value="Nov">Nov</option>
<option value="Dec">Dec</option>
</select>
<select name="year" id="year" style="width:100px">
<option value="Year">Year</option>
{html_options values=$years output=$years}
</select>
</td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr align="center">
<td> </td>
<td align="center">
<div class="buttons">
<button type="button" id="saveAndAdd" name="saveAndAdd" class="positive" onClick="if(validateForm(this.form)) submitForm(this.form, 'index.php?page=Education&action=CreateMore')">
<img src="images/icons/tick.png" alt="icon" /> Save & Add More </button>
<button type="button" id="saveAndClose" name="saveAndClose" class="positive" onClick="if(validateForm(this.form)) this.form.submit();">
<img src="images/icons/tick.png" alt="icon" /> Save & Close </button>
<a href="javascript
: void(0);" onclick="javascript
: return parent.hs.close();" class="negative">
<img src="images/icons/cross.png" alt="icon" /> Close</a>
</div>
</td>
</tr>
</form>
</table>
</fieldset>
</div>
[/HTML]///////////////////////////////////////
if have any solution pls help me.
Thanks and regards
dkyadav80