156
rated 0 times
[
159]
[
3]
/ answers: 1 / hits: 40033
/ 11 Years ago, wed, november 27, 2013, 12:00:00
I'am a newbie here trying to set a value of a hidden field on button click fetching value from a radio button. For some reason I'am able to alert the value but while assigning, it always gives me null.
Please help.
Thanks in advance.
<script type=text/javascript>
function deleteCheck(){
var values = document.getElementById(deleteVisitID).checked;
if (values) {
var hiddenInput = document.getElementById('deleteIDValue');
*hiddenInput.value=document.getElementById(deleteVisitID).value;* <---- throws error
window.open(DeleteAppointmentSelected.jsp,'_self',false);
}else{
alert('Please Enter a ID before submitting');
}
}
</script>
on the form
<table border=1>
<tr><th>visit_id</th><th>visit_date</th><th>visit_time</th><th>physician_id</th><th>Delete Visit</th></tr>
<%
while(visitsForPatient.next()){
%><tr>
<td>
<% visit_id=visitsForPatient.getString(1);%>
<%=visit_id %>
</td>
<td>
<%visit_date=visitsForPatient.getString(2);%>
<%=visit_date %>
</td>
<td>
<%visit_time=visitsForPatient.getString(3);%>
<%=visit_time %>
</td>
<td>
<%physician_id=visitsForPatient.getString(4);%>
<%=physician_id %>
</td>
<td>
<input type=radio name=deleteVisitID id=deleteVisitID value=<%=visit_id %>/>
</td>
</tr>
<%
}
%></table><input type=hidden name=deleteIDValue/>
More From » html