/    Sign up×
Community /Pin to ProfileBookmark

Please help me before I get fired!!

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&nbsp;
<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”>&nbsp;CLIENT SIDE TESTING&nbsp;</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”>&nbsp;IT SIDE TESTING&nbsp;</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>

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@JUDJul 12.2006 — [CODE]
<script type="text/javascript">
var mgmt_type = "", group_name = "", target_date = "";
function showValue(elem){
if(elem.name == "mgmt_type"){
mgmt_type = elem.value;
}else if(elem.name == "groupname"){
group_name = elem.value;
}else if(elem.name == "target_date"){
target_date = elem.value;
}

document.ResForm.new_version.value = mgmt_type + target_date + group_name;
}

</script>
[/CODE]
Copy linkTweet thisAlerts:
@tirion_angelauthorJul 12.2006 — OH!! It worked exactly!! I thank you ever so much!! I don't know what I would have done when the boss got back.

You have saved my job ?
Copy linkTweet thisAlerts:
@JUDJul 12.2006 — You're welcome ?
Copy linkTweet thisAlerts:
@tirion_angelauthorJul 12.2006 — Do you know of any good sites to learn JavaScript?

My boss told me this was a VBScript, ASP, ADO gig, with HTML mixed in. He said nothing about JavaScript, and now, I need to learn it...
Copy linkTweet thisAlerts:
@JUDJul 12.2006 — [URL=http://javascript.about.com/]http://javascript.about.com/[/URL]

If you GOOGLE [B]javascript tutorials[/B] you'll find a shed load of pages to learn from.
×

Success!

Help @tirion_angel spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.25,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...