»
EnglishFrenchVietnamese

Print - SelVal - JavaScriptBank.com

Full version: jsB@nk » Form » Dropdown » SelVal
URL: https://www.javascriptbank.com/selval.html

SelVal © JavaScriptBank.comA function to set values in a textbox in a second form from a Select option list in the first form. This may be modified to go over frames also.

Full version: jsB@nk » Form » Dropdown » SelVal
URL: https://www.javascriptbank.com/selval.html



JavaScript
<SCRIPT language=javascript>function SelVal(fF,tF,fname,tname)<!-- Another small but powerful function by Ira --><!-- Original Programmed by Ira Sterbakov - [email protected] 8/20/04 --><!-- May be freely used and modified - email notification would be nice -->{eval(tF + "." + fname + ".value = " + fF + "." + tname + ".options.value");}</SCRIPT><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<FORM name=mess1><TABLE cellPadding=4 border=0>  <TBODY>  <TR>    <TD>      <P><B>First</B></P></TD>    <TD>      <P><B><SELECT style="WIDTH: 140px"       onchange="SelVal('mess1','mess2','sf1','us1')" name=us1> <OPTION         value="" selected>- None selected -<OPTION value=F1>First Op<OPTION         value=F2>Second Op</OPTION></SELECT></B></P></TD></TR></TBODY></TABLE></FORM><FORM name=mess2><TABLE cellPadding=4 border=0>  <TBODY>  <TR>    <TD>      <P><B>Second</B></P></TD>    <TD>      <P><INPUT size=40 name=sf1></P></TD></TR></TBODY></TABLE></FORM><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->