View Single Post
  #1 (permalink)  
Old February 1st, 2004, 02:21 AM
hosefo81 hosefo81 is offline
Authorized User
Join Date: Oct 2003
Location: KL, wilayah persekutuan, Malaysia.
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts
Default display value of selected radio in the textbox

i want the value of the selected radio button to be displayed on the textboxt.
below are my code and there is an error.
i believe it is in the function1().Please correct my code.

    <title>Search Employee Data</title>
<script language="javascript">
function function1()
    document.searchempform.text1.value =document.searchempform.search_emptype[document.searchempform.search_emptype.selectedInde x].value

</head onload="document.searchempform.reset()">

<form name="searchempform">

<b>How do you want to search? </b><br>
<input type="radio" name="search_emptype" value="searchempid" onclick="function1()">Search by Employee ID<br>
<input type="radio" name="search_emptype" value="searchempfname" onclick="function1()">Search by Employee Name<br>
<input type="radio" name="search_emptype" value="searchemplname" onclick="function1()">Search by Employee Name<br>

<input type="text" name="text1" size="10">
<input id="empsearchbut" type="button" name="empsearch" size="10" value="Search" onclick="function1()" >