please help me i got some problem with my code. my drop down lists which displays a text box when a selection is made, does not display an input in a database when i write a text in the text box.

<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript"> 
<!-- 
function showHideSelection() 
  { 
   if (document.drop_list.Category.value == 'Others'){
addOption(document.drop_list.SubCat,"Pls. Specify:");
document.getElementById('boxid').onchange=function(){
if (this.selectedIndex==44)
this.form['box'].style.visibility='visible';
else
this.form['box'].style.visibility='hidden';
};
}
}
 //--> 
</SCRIPT> 

<tr>
          <td colspan="2"><b>What agency is involved? <font face="Verdana" color="#800000">*</font></b><br>
            <font face="Arial" style="font-size:8pt" color="#008080"></font></td>
        </tr>
        <tr>
          <td>

<form name=agency action="">
<select onchange="if (this.selectedIndex==44){this.form['box'].style.visibility='visible'}else {this.form['box'].style.visibility='hidden'};">
<option> 
<option>Office of the President
<option>Office of the Vice President
<option>Department of Agrarian Reform (DAR)
<option>Department of Agriculture (DA)
<option>Department of Budget and Management (DBM)
<option>Department of Education (DepEd)
<option>Department of Energy (DOE)
<option>Department of Environment and Natural Resources (DENR)
<option>Department of Finance (DOF)
<option>Department of Foreign Affairs (DFA)
<option>Department of the Interior and Local Government (DILG)
<option>Department of Health (DOH)
<option>Department of Justice (DOJ)
<option>Department of Labor and Employment (DOLE)
<option>Department of National Defense (DND)
<option>National Economic and Development Authority (NEDA)
<option>Office of the Press Secretary (OPS)
<option>Department of Public Works and Highways (DPWH)
<option>Department of Science and Technology (DOST)
<option>Department of Social Welfare and Development (DSWD)
<option>Department of Tourism (DOT)
<option>Department of Trade & Industry (DTI)
<option>Department of Transportation & Communications (DOTC)
<option>Banko Sentral ng Pilipinas (BSP)
<option>Commission on Audit (COA)
<option>Civil Service Commission (CSC)
<option>Commission on Elections (COMELEC)
<option>Office of the Ombudsman (OMBUDSMAN)
<option>Commission on Human Rights (CHR)
<option>Supreme Court of the Philippines (SC)
<option>Court of Appeals (CA)
<option>Sandiganbayan (SB)
<option>The Philippine Senate (SENATE)
<option>House of Representatives (CONGRESS)
<option>Land Bank of the Philippines (LBP)
<option>Philippine Deposit Insurance Corporation (PDIC)
<option>Development Bank of the Philippines (DBP)
<option>Bases Conversion Development Authority (BCDA)
<option>Al-Amanah Islamic Investment Bank Of The Philippines (AAIIBP)
<option>Government Service Insurance System (GSIS)
<option>Social Security System (SSS)
<option>Armed Forces of the Philippines (AFP)
<option>Philippine National Police (PNP)
<option value="">Others
<input style="visibility:hidden;" type="text" id="boxid" name="box" maxlength="200" size="63">
</select>

</form>


</td>
          <td width="100">&nbsp;</td>
        </tr>
        <tr>

Recommended Answers

All 3 Replies

Place your text box outside of the select statement and this should alleviate your problem.

is this solved ?

yup thanks for the help you have given me.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.