Hi,
I have an HTML table dynamically populated with data from a coldfusion query and having radio buttons - see code following below.
I need javascript to see the radio buttons and the user's selection - "approved"; "denied"; or, "N/A". If the user selects "approved" for multiple rows and then Submit the information will update the database table and remove those rows.
However, if the user selects "approved" and "denied" then I need to update the "approved" rows and stop the update at the "denied" row and show a dialog box which informs the user that the "Reason for Denial" text box must be entered. Then the Submit button can be engaged and the "denied" selection processed. Only one "denied" at a time will be updated - but all "approved" entries can be denied similtaneously - unless a "denied" intervenes.
I do have javascript code for the "denied" selection with empty "Reason for Denial" text box - see below:
The overall action seems like it would need some extensive javascript coding and I haven't a clue how to do it. Any help is GREATLY APPRECIATED.
Thank you,
John
I have an HTML table dynamically populated with data from a coldfusion query and having radio buttons - see code following below.
I need javascript to see the radio buttons and the user's selection - "approved"; "denied"; or, "N/A". If the user selects "approved" for multiple rows and then Submit the information will update the database table and remove those rows.
However, if the user selects "approved" and "denied" then I need to update the "approved" rows and stop the update at the "denied" row and show a dialog box which informs the user that the "Reason for Denial" text box must be entered. Then the Submit button can be engaged and the "denied" selection processed. Only one "denied" at a time will be updated - but all "approved" entries can be denied similtaneously - unless a "denied" intervenes.
I do have javascript code for the "denied" selection with empty "Reason for Denial" text box - see below:
Code:
<script type="text/javascript">
function rationale() {
var denInfo = document.getElementById("denialReason");
if(denInfo.value == ""){
alert("Please enter reason for denial in Rationale for Request Denial");
return false;
denInfo.focus();
}
}
</script>
The overall action seems like it would need some extensive javascript coding and I haven't a clue how to do it. Any help is GREATLY APPRECIATED.
Code:
<table border="1" cellspacing="1" cellpadding="2" style="position:relative; left:50px;" width="1000">
<tr>
<td width="140" align="center" bgcolor="#FEF9E7"><font color="#0000FF" style="font-weight:bold;"> Name<hr />Begin Date</font></td>
<td width="75" align="center" bgcolor="#FEF9E7"><font color="#0000FF" style="font-weight:bold;"> Request Date<hr />End Date</font></td>
<td width="145" align="center" bgcolor="#FEF9E7"><font color="#0000FF" style="font-weight:bold;">Type of Hrs<hr />Request Justification</font></td>
<td width="76" align="center" bgcolor="#FEF9E7"><font color="#0000FF" style="font-weight:bold;"> Num Hrs Req<hr />Rel Comp Begin Date</font></td>
<td width="98" align="center" bgcolor="#FEF9E7"><font color="#0000FF" style="font-weight:bold;"> Projects<hr />Rel Comp End Date</font></td>
<td width="180" align="center" bgcolor="#FEF9E7"><font color="#0000FF" style="font-weight:bold;"> Decision<hr />Leave Slip Submitted</font></td>
</tr>
<cfoutput query="Req">
<tr style="background-color:'FFFFFF';" onMouseOver="this.style.backgroundColor='FFCC33';" onMouseOut="this.style.backgroundColor='FFFFFF'" >
<td colspan="6">
<table cols="6" border="1" cellpadding="5" cellspacing="0">
<tr>
<td width="177"> #Name#</td>
<td width="107"> #DateFormat(RequestDate, "m/d/yyyy")#</td>
<td width="178"> #TypeofHours#</td>
<td width="105"> #NumberHrsRequested#</td>
<td width="127"> #project#</td>
<td width="218"> #Decision#
<cfinput name="Decision_#ID#" id="Decision_#ID#" type="radio" value="approved" size="1">Approve
<cfinput name="Decision_#ID#" id="Decision_#ID#" type="radio" value="denied" size="1">Deny
<cfinput name="Decision_#ID#" id="Decision_#ID#" type="radio" value="" size="1" checked="yes">N/A
</td>
</tr>
<tr>
<td> #DateFormat(BeginDate, "m/d/yyyy")#</td>
<td> #DateFormat(EndDate, "m/d/yyyy")#</td>
<td> #justification#</td>
<td> #DateFormat(RCBDate, "m/d/yyyy")#</td>
<td> #DateFormat(RCEDate, "m/d/yyyy")#</td>
<td> #RCLeaveSlip#</td>
</tr>
<tr id="denyRow_#ID#">
<td colspan="1"><font color="##0000FF"; style="font-weight:bold">Reason For Denial</font></td>
<td colspan="5"> #ReasonForDenial#
<cftextarea name="denial_#ID#" cols="85" rows="3" wrap="hard"/>
</td>
</tr>
</table>
</td>
</tr>
</cfoutput>
</table>
Thank you,
John