Okay, so I am a student and took this gig designing sites over the summer. Usually I am cool. Now, I have a problem.
I am not familiar with JavaScript at all.
Here is my problem:
I have three fields, mgmt_type and groupname which are radio buttons and target_date which is a textbox.
Each time someone clicks on one of thiese options, or loses focus in the case of the textbox, I need the value to pop into the new_version textbox. BUT it can’t erase what was before it. Plus, it has to be entered a certain way despite which button the user selects first.
So basically, the new_version textbox needs to finish with the format
(mgmt_type)(target_date)(groupname) everytime, even if someone enters the fields in a different order. It should come out looking like CM20061127H, generally. What I have so far, is below ? Thank you in advanced!!!
<html>
<head>
<title>Openlink@Enbridge Issue Manager</title>
<meta name=”GENERATOR” content=”YesSoftware CodeCharge v.2.0.3 / Templates.ccp build 10/17/2001″>
<meta http-equiv=”pragma” content=”no-cache”>
<meta http-equiv=”expires” content=”0″>
<meta http-equiv=”cache-control” content=”no-cache”>
<meta http-equiv=”Content-Type” content=”text/html; charset=ISO-8859-1″><link rel=”stylesheet” href=”Site.css” type=”text/css”>
<link rel=”stylesheet” href=”IssueChange.css” type=”text/css”>
<link rel=”stylesheet” href=”Footer.css” type=”text/css”>
<script type=”text/javascript”>
function showValue(mgmt_type)
{
if (mgmt_type)
{
document.ResForm.new_version.value = mgmt_type.value;
}
if (groupname)
{
document.ResForm.new_version.value = groupname.value;
}
if (target_date)
{
document.ResForm.new_version.value = target_date.value;
}
else if (new_version==mgmt_type)
{
document.ResForm.new_version.value = mgmt_type+target_date+groupname;
}
}
</script>
</head>
<body class=”PageBODY”>
{Header}
<table>
<tr>
<td valign=”top”>
<!–BeginResponseForm–>
<form method=”POST” action=”chmgmtsave.asp” name=”ResForm”>
<table class=”FormTABLE”>
<tr>
<td class=”FormHeaderTD” colspan=”4″><font class=”FormHeaderFONT”>Change Management</font></td>
</tr>
<br><br>
<tr>
<td class=”FieldCaptionTDs”><font class=”FieldCaptionFONTs”>Current Version</font><br>
<font class=”DataFONT”>{version}</font></td>
<td class=”FieldCaptionTDs”><font class=”FieldCaptionFONTs”>New Version</font><br>
<font class=”DataFONT”><input type=”text” name=”new_version” disabled></input></font></td>
<td class=”FieldCaptionTDs”><font class=”FieldCaptionFONTs”>Test Script Required?</font><br>
<font class=”DataFont”><input {tsreq_1} type=”radio” value=”Yes” name=”tsreq”>Yes
<input {tsreq_2} type=”radio” value=”No” name=”tsreq”>No</td>
<td class=”FieldCaptionTDs”><font class=”FieldCaptionFONTs”></font><br>
<font class=”DataFONT”><input type=”hidden” name=”issue_id2″ value=”{issue_id2}”/></font></td>
<tr bgcolor=#2200a5 valign=”LEFT”>
<td class=”FieldCaptionTDs” colspan=”4″><font class=”ColumnHI”>CHANGE VERSION?</font></td>
</tr>
<tr bgcolor=#CCFFFF valign=”TOP”>
<td class=”FieldCaptionTDs”><font class=”FieldCaptionFONTs”>Management Type</font><br>
<font class=”DataFonts”>
<input {mgmt_1} type=”radio” name=”mgmt_type” value=”CM” onClick=”showValue(this);”>Change Mgmt
<input {mgmt_2} type=”radio” name=”mgmt_type” value=”EM” onClick=”showValue(this);”>Emergency</td>
<td class=”FieldCaptionTDs”><font class=”FieldCaptionFONTs”>Client/Group</font><br>
<font class=”DataFonts”><input {clgr_1} type=”radio” name=”groupname” value=”C” onClick=”showValue(this);”>Calgary Risk
<input {clgr_2} type=”radio” name=”groupname” value=”O” onClick=”showValue(this);”>Operation<br>
<input {clgr_3} type=”radio” name=”groupname” value=”H” onClick=”showValue(this);”>Houston Risk
<input {clgr_4} type=”radio” name=”groupname” value=”T” onClick=”showValue(this);”>Treasury<br>
<input {clgr_5} type=”radio” name=”groupname” value=”F” onClick=”showValue(this);”>Front Office</td>
<td class=”FieldCaptionTDs”><font class=”FieldCaptionFONTs”>Target Date</font><br>
<font class=”DataFont”><textarea name=”target_date” cols=”10″ rows=”1″ onBlur=”showValue(this);”>{target_date}</textarea>
<br> Format: YYYYMMDD
<br>July 15, 2006 = 20060715
</td>
</tr>
<tr bgcolor=#2200a5 valign=”TOP”>
<td class=”FieldCaptionTDs” colspan=”3″><font class=”ColumnHI”> CLIENT SIDE TESTING </font>
</td>
</tr>
<tr bgcolor=#CCFFFF>
<td class=”FieldCaptionTDs”><font class=”FieldCaptionFONTs”>Tested?</font><br>
<font class=”DataFonts”><input {tested_11} type=”radio” name=”tested_1″ value=”1″>Yes
<input {tested_12} type=”radio” name=”tested_1″ value=”0″>No</td>
<td class=”DataTD”><font class=”FieldCaptionFONTs”>Test Script Complete?</font><br>
<font class=”DataFonts”><input {testscript_11} type=”radio” name=”testscript_1″ value=”Yes”>Yes
<input {testscript_12} type=”radio” name=”testscript_1″ value=”No”>No</td>
<td class=”FieldCaptionTDs”><font class=”FieldCaptionFONTs”>Tested By</font><br>
<select name=”Client_Tested_by”>{Client_Tested_by}</select>
</td>
</tr>
<tr bgcolor=#2200a5 valign=”TOP”>
<td class=”FieldCaptionTDs” colspan=”3″><font class=”ColumnHI”> IT SIDE TESTING </font>
</td>
</tr>
<tr bgcolor=#CCFFFF>
<td class=”FieldCaptionTDs”><font class=”FieldCaptionFONTs”>Tested?</font><br>
<font class=”DataFonts”><input {tested_21} type=”radio” name=”tested_2″ value=”1″>Yes
<input {tested_22} type=”radio” name=”tested_2″ value=”0″>No</td>
<td class=”DataTD”><font class=”FieldCaptionFONTs”>Test Script Complete?</font><br>
<font class=”DataFonts”><input {testscript_21} type=”radio” name=”testscript_2″ value=”Yes”>Yes
<input {testscript_22} type=”radio” name=”testscript_2″ value=”No”>No</td>
<td class=”FieldCaptionTDs”><font class=”FieldCaptionFONTs”>Tested By</font><br>
<select name=”IT_tested_by”>{IT_Tested_by}</select>
</td>
</tr>
<tr bgcolor=#CCFFFF>
<td class=”FieldCaptionTDs” colspan=”4″><font class=”FieldCaptionFONTs”>MIGRATION INSTRUCTIONS</font><br>
<textarea name=”migration_instructions” cols=”80″ rows=”5″>{migration}</textarea>
</td>
</tr>
<tr>
<td colspan=”4″ align=”right”>
<!– *** Buttons *** –>
<input type=”submit” value=”Submit”>
</table>
</form>
<!–EndResponseForm–>
</td>
</tr>
</table>
{Footer}
</body>
</html>