Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

There's a select option to choose from(1). Upon clicking any of the op

Status
Not open for further replies.

Rachel80

Programmer
May 25, 2000
63
GB
There's a select option to choose from(1). Upon clicking any of the options will trigger a JS function(2) to display the corresponding value on another input box(3) <br>------------------------------------------------------------<br>(1)<br>&lt;tr&gt;<br>&lt;td&gt;Payment Type&lt;/td&gt;<br>&lt;td&gt;<br>&lt;select name=&quot;paymenttype&quot; size=&quot;1&quot;&gt;<br> &lt;option value=&quot;ALL&quot; onClick=&quot;show_company(paymenttype);&quot; selected&gt;----All----&lt;/option&gt;<br> &lt;option value=&quot;LL&quot; onClick=&quot;show_company(paymenttype);&quot;&gt;Licensee&lt;/option&gt;<br> &lt;option value=&quot;RL&quot; onClick=&quot;show_company(paymenttype);&quot;&gt;Retailer&lt;/option&gt;<br>&lt;/select&gt;&lt;/td&gt;<br>&lt;/tr&gt;<br><br>(2)<br>&lt;script language=&quot;Javascript&quot;&gt;<br><br>function show_company(PT)<br>{<br>&nbsp;&nbsp;switch(PT)<br>&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case &quot;All&quot;: step A; break;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case &quot;RL&quot;: step B; break;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case &quot;LL&quot;: step C; break;<br>&nbsp;&nbsp;}<br><br>&nbsp;&nbsp;return company_name<br>}<br>&lt;/script&gt;<br><br>(3)<br>&lt;tr&gt;<br>&lt;td&gt;Company Name&lt;/td&gt;<br>&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;company&quot; value=&quot;&lt;cfoutput&gt;#company_name#&lt;/cfoutput&gt;&quot;&gt;&lt;/td&gt;<br>&lt;/tr&gt;<br>------------------------------------------------------------<br>Q:<br>Can the JS function: show_company(paymenttype); query the required values and output on a textbox or similar?<br>(The above functions are not complete bcoz I'm stuck..)<br>Pls help, thank you!<br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top