Hi,
I have a form which I need add together a number from a previous calculation with a number that the user inputs but I can’t seem to get CapEx recognised as a number! Can anyone help me please! I have put the code below:
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “
<html xmlns=”
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ />
<title>Untitled Document</title>
<script></script>
<script type=”text/javascript”>
<!–
function resettoggle() {
var e = document.getElementById(‘foo’);
e.style.display = ‘none’;
}
function toggle_visibility(id) {
var e = document.getElementById(id);
if(e.style.display == ‘none’)
e.style.display = ‘block’;
else
e.style.display = ‘none’;
}
//–>
</script>
</head>
<body onLoad=”resettoggle()”>
<tr>
<td><div class=”fieldlabel”>Change Title:</div></td>
<td></td>
<td><textarea name=”userstringvalue(1requestfctitle)” rows=”2″ class=”datafield”></textarea></td>
<td></td>
<td><div class=”errormsg”></div></td>
</tr>
<tr>
<td><div class=”fieldlabel”>Requested By:</div></td>
<td></td>
<td><textarea name=”userstringvalue(2requestfcrequestor)” rows=”1″ class=”datafield”></textarea></td>
<td></td>
<td><div class=”errormsg”></div></td>
</tr>
<tr>
<td><div class=”fieldlabel”>HOTB:</div></td>
<td></td>
<td><textarea name=”userstringvalue(3requestfcHOT?” rows=”1″ class=”datafield”></textarea></td>
<td></td>
<td><div class=”errormsg”></div></td>
</tr>
<tr>
<td><div class=”fieldlabel”>Change Description:</div></td>
<td></td>
<td><textarea name=”userstringvalue(4requestfcdesc)” rows=”3″ class=”datafield”></textarea></td>
<td></td>
<td><div class=”errormsg”></div></td>
</tr>
<tr>
<td><div class=”fieldlabel”>Required By Date:</div></td>
<td>
<a href=”#” onClick=”cal1.select(document.forms[0][‘userstringvalue(5requestfcrequired)’],’anchor1′,’dd/MM/yy’); return false;” NAME=”anchor1″ ID=”anchor1″>
<img src=”/assystEnterprise/shared/images/calendar.gif” border=”0″ hspace=”0″ vspace=”0″>
</a>
</td>
<td><textarea name=”userstringvalue(5requestfcrequired)” rows=”1″ class=”datafield”></textarea></td>
<td></td>
<td><div class=”errormsg”></div></td>
</tr>
<tr>
<td><div class=”fieldlabel”>Total Man Days:</div></td>
<td></td>
<td><textarea name=”manDays” rows=”1″ class=”datafield”></textarea></td>
<td></td>
<td><div class=”errormsg”></div></td>
</tr>
<INPUT TYPE=”button” NAME=”DoIt” VALUE=”calculate resource cost” OnClick=”Resource.value= ‘£’ +(manDays.value * 400)”><br />
<tr>
<td>
<INPUT TYPE=”text” NAME=”Resource” Size=”16″>
<br>
</td>
</tr>
<tr>
<td><div class=”fieldlabel”>CapEx Cost (£):</div></td>
<td></td>
<td><textarea name=”CapEx” rows=”1″ class=”datafield”></textarea></td>
<td></td>
<td><div class=”errormsg”></div></td>
</tr>
<INPUT TYPE=”button” NAME=”DoIt” VALUE=”total cost of change” onclick=”Total.value= ‘£’ + Number(Resource.value.replace(/£/,”)) + Number(CapEx.value)”><br />
<tr>
<td>
<INPUT TYPE=”text” NAME=”Total” Size=”16″>
<br>
</td>
</tr>
<a href=”#” onclick=”toggle_visibility(‘foo’);”>Click here if the Total Cost of Change is less than £5k</a><br />
<div id=”foo”>
<tr>
<td colspan=”5″><h3>If the Total Cost of Change is less than £5k, please complete the following fields…</h3></td>
<td></td>
</tr>
<tr>
<td><div class=”fieldlabel”>Reasons for Change:</div></td>
<td></td>
<td><textarea name=”userstringvalue(8requestfcreasons)” rows=”3″ class=”datafield”></textarea></td>
<td></td>
<td><div class=”errormsg”></div></td>
</tr>
<tr>
<td><div class=”fieldlabel”>Known RIDAs:</div></td>
<td></td>
<td><textarea name=”userstringvalue(9requestfcrida)” rows=”3″ class=”datafield”></textarea></td>
<td></td>
<td><div class=”errormsg”></div></td>
</tr>
<tr>
<td><div class=”fieldlabel”>Resource Requirements:</div></td>
<td></td>
<td><textarea name=”userstringvalue(10requestfcresource)” rows=”3″ class=”datafield”></textarea></td>
<td></td>
<td><div class=”errormsg”></div></td>
</tr>
<tr>
<td><div class=”fieldlabel”>Additional Info:</div></td>
<td></td>
<td><textarea name=”userstringvalue(11requestfcaddinfo)” rows=”2″ class=”datafield”></textarea></td>
<td></td>
<td><div class=”errormsg”></div></td>
</tr>
<tr><td colspan=”5″><hr/></td></tr>
<tr>
<td colspan=”5″>
</div>
<br />
<tr>
<td colspan=”56″><h3>If the Total Cost of Change is more than £5k, please attach a Project Brief to this request.<br><a title=”Project Brief” href=”file:///S:/!TBPM%20Templates/1.%20Selecting%20Business%20Change/Project%20Brief%20Template%20v1.0.doc” target=”_blank”>Click here</a> to view the Project Brief template from the <a title=”Processes and Controls” href=”http://nrfour/files/Intranet%20Spec%20V3.htm” target=”_blank”>Processes & Controls area</a> of the intranet.</h3></td>
<td></td>
</tr>
<br />
<input type=”submit” name=”LogEvent” value=”Submit” onclick=”setDispatchTarget(‘logEvent’);” class=”button”>
</body>
</html>
[code] tags it is much easier to read
3. There is no need for table based layouts
4. Why are you using XHTML if your not going to a) write valid XHTML and b) not going to serve it as application/xhtml-xml?
Now that I said that, post some of the javascript functions and maybe we can see whats up.
[code]
<tr>
<td><div class="fieldlabel">Total Man Days:</div></td>
<td></td>
<td><textarea name="manDays" rows="1" class="datafield" onBlur="Resource.value= '£' +(manDays.value * 400)"></textarea></td>
<td></td>
<td><div class="errormsg"></div></td>
</tr>
<tr>
<td>
<INPUT TYPE="text" NAME="Resource" Size="16">
<br>
</td>
</tr>
<tr>
<td><div class="fieldlabel">CapEx Cost (£):</div></td>
<td></td>
<td><textarea name="CapEx" rows="1" class="datafield" onBlur="Total.value= '£' +(Resource.value.replace(/£/,'')) + Number(CapEx.value)"></textarea></td>
<td></td>
<td><div class="errormsg"></div></td>
<td>
<p>total cost
<INPUT TYPE="text" NAME="Total" Size="16">
<br>
</td>
</tr>
, you need a [ / code] (no spaces). Here's how I would do it.
[code=php]
//all this needs to be in <script> tags at the top
function setResource (val) {
var resource = document.getElementById("resource"); //get the input field
val *= 400; //multiply the value by 400;
resource.value = "$" +val; //set the value
//dont know how to make a pound sign lol
}
function setTotal(val) {
var resourceVal = document.getElementById("resource").value; //get the value
var total = document.getElemetnById("total");
val = val.replace(/$/, ''); //remove the "pound" sign
val = parsefloat(val) //convert to a floating point number (with decimals)
//if its only integers, you can use "parseint(val)"
val += resourceVal; //add the values
total.value = '$' +val; <br/>
}
[code=html]
<textarea name="manDays" rows="1" class="datafield" onblur="setResource(this.value)"></textarea>
<!-- xhtml requires all lowercase letters and the use of "id" instead of "name"-->
<input type="text" id="resource" size="16">
<textarea name="CapEx" rows="1" class="datafield" onblur="setTotal(this.value)"></textarea>
<input type="text" id="total" size="16">[/code]
<i>
</i> var total = document.getElemetnById("total");
<i>
</i>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script></script>
<script type="text/javascript">
<!--
function resettoggle() {
var e = document.getElementById('extraFields');
e.style.display = 'none';
}
function toggle_visibility(id) {
var e = document.getElementById(id);
if(e.style.display == 'none')
e.style.display = 'block';
else
e.style.display = 'none';
}
//all this needs to be in <script> tags at the top
function setResource (val) {
var resource = document.getElementById("resource"); //get the input field
val *= 400; //multiply the value by 400;
resource.value = "£" +val; //set the value
}
function setResource (val) {
var resource = document.getElementById("resource"); //get the input field
val *= 400; //multiply the value by 400;
resource.value = "£" +val; //set the value
}
function setTotal(val) {
var resourceVal = document.getElementById("resource").value; //get the value
var total = document.getElemetnById("total");
val = val.replace(/£/, ''); //remove the "pound" sign
val = parsefloat(val) //convert to a floating point number (with decimals)
//if its only integers, you can use "parseint(val)"
val += resourceVal; //add the values
total.value = '£' +val; <br/>
}
//-->
</script>
</head>
<body onLoad="resettoggle()">
<tr>
<td><div class="fieldlabel">Change Title:</div></td>
<td></td>
<td><textarea name="userstringvalue(1requestfctitle)" rows="2" class="datafield"></textarea></td>
<td></td>
<td><div class="errormsg"></div></td>
</tr>
<tr>
<td><div class="fieldlabel">Requested By:</div></td>
<td></td>
<td><textarea name="userstringvalue(2requestfcrequestor)" rows="1" class="datafield"></textarea></td>
<td></td>
<td><div class="errormsg"></div></td>
</tr>
<tr>
<td><div class="fieldlabel">HOTB:</div></td>
<td></td>
<td><textarea name="userstringvalue(3requestfcHOTB)" rows="1" class="datafield"></textarea></td>
<td></td>
<td><div class="errormsg"></div></td>
</tr>
<tr>
<td><div class="fieldlabel">Change Description:</div></td>
<td></td>
<td><textarea name="userstringvalue(4requestfcdesc)" rows="3" class="datafield"></textarea></td>
<td></td>
<td><div class="errormsg"></div></td>
</tr>
<tr>
<td><div class="fieldlabel">Required By Date:</div></td>
<td>
<a href="#" onClick="cal1.select(document.forms[0]['userstringvalue(5requestfcrequired)'],'anchor1','dd/MM/yy'); return false;" NAME="anchor1" ID="anchor1">
<img src="/assystEnterprise/shared/images/calendar.gif" border="0" hspace="0" vspace="0">
</a>
</td>
<td><textarea name="userstringvalue(5requestfcrequired)" rows="1" class="datafield"></textarea></td>
<td></td>
<td><div class="errormsg"></div></td>
</tr> <br/>
<tr>
<td><div class="fieldlabel">Total Man Days:</div></td>
<td></td>
<td> <textarea name="manDays" rows="1" class="datafield" onblur="setResource(this.value)"></textarea></td>
<td></td>
<td><div class="errormsg"></div></td>
</tr>
<tr>
<td>
<input type="text" id="Resource" size="16">
<br>
</td>
</tr>
<i> </i> <tr>
<i> </i> <td><div class="fieldlabel">CapEx Cost (£):</div></td>
<i> </i> <td></td>
<i> </i> <td><textarea name="CapEx" rows="1" class="datafield" onblur="setTotal(this.value)"></textarea></td>
<i> </i> <td></td>
<i> </i> <td><div class="errormsg"></div></td>
<i> </i> <td>
<i> </i> <p>total cost
<i> </i> <input type="text" name="Total" size="16">
<i> </i> <br>
<i> </i> </td>
<i> </i> </tr>
<i> </i> <a href="#" onclick="toggle_visibility('extraFields');">Click here if the Total Cost of Change is less than &pound;5k</a><br />
<i> </i> <div id="extraFields">
<i> </i> <tr>
<i> </i> <td colspan="5"><h3>If the Total Cost of Change is less than £5k, please complete the following fields...</h3></td>
<i> </i> <td></td>
<i> </i> </tr>
<i> </i> <tr>
<i> </i> <td><div class="fieldlabel">Reasons for Change:</div></td>
<i> </i> <td></td>
<i> </i> <td><textarea name="userstringvalue(8requestfcreasons)" rows="3" class="datafield"></textarea></td>
<i> </i> <td></td>
<i> </i> <td><div class="errormsg"></div></td>
<i> </i> </tr>
<i> </i> <tr>
<i> </i> <td><div class="fieldlabel">Known RIDAs:</div></td>
<i> </i> <td></td>
<i> </i> <td><textarea name="userstringvalue(9requestfcrida)" rows="3" class="datafield"></textarea></td>
<i> </i> <td></td>
<i> </i> <td><div class="errormsg"></div></td>
<i> </i> </tr>
<i> </i> <tr>
<i> </i> <td><div class="fieldlabel">Resource Requirements:</div></td>
<i> </i> <td></td>
<i> </i> <td><textarea name="userstringvalue(10requestfcresource)" rows="3" class="datafield"></textarea></td>
<i> </i> <td></td>
<i> </i> <td><div class="errormsg"></div></td>
<i> </i> </tr>
<i> </i> <tr>
<i> </i> <td><div class="fieldlabel">Additional Info:</div></td>
<i> </i> <td></td>
<i> </i> <td><textarea name="userstringvalue(11requestfcaddinfo)" rows="2" class="datafield"></textarea></td>
<i> </i> <td></td>
<i> </i> <td><div class="errormsg"></div></td>
<i> </i> </tr>
<i> </i> <tr><td colspan="5"><hr/></td></tr>
<i> </i> <tr>
<i> </i> <td colspan="5">
<i> </i> </div>
<i> </i> <br />
<i> </i> <tr>
<i> </i> <td colspan="56"><h3>If the Total Cost of Change is more than £5k, please attach a Project Brief to this request.<br><a title="Project Brief" href="file:///S:/!TBPM%20Templates/1.%20Selecting%20Business%20Change/Project%20Brief%20Template%20v1.0.doc" target="_blank">Click here</a> to view the Project Brief template from the <a title="Processes and Controls" href="http://nrfour/files/Intranet%20Spec%20V3.htm" target="_blank">Processes & Controls area</a> of the intranet.</h3></td>
<i> </i> <td></td>
<i> </i> </tr>
<i> </i> <br />
<i> </i> <input type="submit" name="LogEvent" value="Submit" onclick="setDispatchTarget('logEvent');" class="button">
</body>
</html>
<i>
</i>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script></script>
<script type="text/javascript">
<!--
function resettoggle() {
var e = document.getElementById('extraFields');
e.style.display = 'none';
}
function toggle_visibility(id) {
var e = document.getElementById(id);
if(e.style.display == 'none')
e.style.display = 'block';
else
e.style.display = 'none';
}
function setResource (val) {
var resource = document.getElementById("resource"); //get the input field
val *= 400; //multiply the value by 400;
resource.value = "£" +val; //set the value
}
function setTotal(val) {
var resourceVal = document.getElementById("resource").value; //get the value
var total = document.getElementById("total").value;
val = val.replace(/£/, ''); //remove the "pound" sign
val = parseint(val) //convert to a floating point number (with decimals)
//if its only integers, you can use "parseint(val)"
val += resourceVal; //add the values
total.value = '£' +val; <br/>
}
//-->
</script>
</head>
<body onLoad="resettoggle()">
<tr>
<td><div class="fieldlabel">Change Title:</div></td>
<td></td>
<td><textarea name="userstringvalue(1requestfctitle)" rows="2" class="datafield"></textarea></td>
<td></td>
<td><div class="errormsg"></div></td>
</tr>
<tr>
<td><div class="fieldlabel">Requested By:</div></td>
<td></td>
<td><textarea name="userstringvalue(2requestfcrequestor)" rows="1" class="datafield"></textarea></td>
<td></td>
<td><div class="errormsg"></div></td>
</tr>
<tr>
<td><div class="fieldlabel">HOTB:</div></td>
<td></td>
<td><textarea name="userstringvalue(3requestfcHOTB)" rows="1" class="datafield"></textarea></td>
<td></td>
<td><div class="errormsg"></div></td>
</tr>
<tr>
<td><div class="fieldlabel">Change Description:</div></td>
<td></td>
<td><textarea name="userstringvalue(4requestfcdesc)" rows="3" class="datafield"></textarea></td>
<td></td>
<td><div class="errormsg"></div></td>
</tr>
<tr>
<td><div class="fieldlabel">Required By Date:</div></td>
<td>
<a href="#" onClick="cal1.select(document.forms[0]['userstringvalue(5requestfcrequired)'],'anchor1','dd/MM/yy'); return false;" NAME="anchor1" ID="anchor1">
<img src="/assystEnterprise/shared/images/calendar.gif" border="0" hspace="0" vspace="0">
</a>
</td>
<td><textarea name="userstringvalue(5requestfcrequired)" rows="1" class="datafield"></textarea></td>
<td></td>
<td><div class="errormsg"></div></td>
</tr> <br/>
<tr>
<td><div class="fieldlabel">Total Man Days:</div></td>
<td></td>
<td> <textarea name="manDays" rows="1" class="datafield" onblur="setResource(this.value)"></textarea></td>
<td></td>
<td><div class="errormsg"></div></td>
</tr>
<tr>
<td>
<input type="text" id="Resource" size="16">
<br>
</td>
</tr>
<i> </i> <tr>
<i> </i> <td><div class="fieldlabel">CapEx Cost (£):</div></td>
<i> </i> <td></td>
<i> </i> <td><textarea name="CapEx" rows="1" class="datafield" onblur="setTotal(this.value)"></textarea></td>
<i> </i> <td></td>
<i> </i> <td><div class="errormsg"></div></td>
<i> </i> <td>
<i> </i> <p>total cost
<i> </i> <input type="text" id="Total" size="16">
<i> </i> <br>
<i> </i> </td>
<i> </i> </tr>
<i> </i> <a href="#" onclick="toggle_visibility('extraFields');">Click here if the Total Cost of Change is less than &pound;5k</a><br />
<i> </i> <div id="extraFields">
<i> </i> <tr>
<i> </i> <td colspan="5"><h3>If the Total Cost of Change is less than £5k, please complete the following fields...</h3></td>
<i> </i> <td></td>
<i> </i> </tr>
<i> </i> <tr>
<i> </i> <td><div class="fieldlabel">Reasons for Change:</div></td>
<i> </i> <td></td>
<i> </i> <td><textarea name="userstringvalue(8requestfcreasons)" rows="3" class="datafield"></textarea></td>
<i> </i> <td></td>
<i> </i> <td><div class="errormsg"></div></td>
<i> </i> </tr>
<i> </i> <tr>
<i> </i> <td><div class="fieldlabel">Known RIDAs:</div></td>
<i> </i> <td></td>
<i> </i> <td><textarea name="userstringvalue(9requestfcrida)" rows="3" class="datafield"></textarea></td>
<i> </i> <td></td>
<i> </i> <td><div class="errormsg"></div></td>
<i> </i> </tr>
<i> </i> <tr>
<i> </i> <td><div class="fieldlabel">Resource Requirements:</div></td>
<i> </i> <td></td>
<i> </i> <td><textarea name="userstringvalue(10requestfcresource)" rows="3" class="datafield"></textarea></td>
<i> </i> <td></td>
<i> </i> <td><div class="errormsg"></div></td>
<i> </i> </tr>
<i> </i> <tr>
<i> </i> <td><div class="fieldlabel">Additional Info:</div></td>
<i> </i> <td></td>
<i> </i> <td><textarea name="userstringvalue(11requestfcaddinfo)" rows="2" class="datafield"></textarea></td>
<i> </i> <td></td>
<i> </i> <td><div class="errormsg"></div></td>
<i> </i> </tr>
<i> </i> <tr><td colspan="5"><hr/></td></tr>
<i> </i> <tr>
<i> </i> <td colspan="5">
<i> </i> </div>
<i> </i> <br />
<i> </i> <tr>
<i> </i> <td colspan="56"><h3>If the Total Cost of Change is more than £5k, please attach a Project Brief to this request.<br><a title="Project Brief" href="file:///S:/!TBPM%20Templates/1.%20Selecting%20Business%20Change/Project%20Brief%20Template%20v1.0.doc" target="_blank">Click here</a> to view the Project Brief template from the <a title="Processes and Controls" href="http://nrfour/files/Intranet%20Spec%20V3.htm" target="_blank">Processes & Controls area</a> of the intranet.</h3></td>
<i> </i> <td></td>
<i> </i> </tr>
<i> </i> <br />
<i> </i> <input type="submit" name="LogEvent" value="Submit" onclick="setDispatchTarget('logEvent');" class="button">
</body>
</html>
<i>
</i>function setResource (val) {
var resource = document.getElementById("resource"); //get the input field
val *= 400; //multiply the value by 400;
resource.value = "$" +val; //set the value
}
function setTotal(val) {
var resourceVal = document.getElementById("resource").value; //get the value
var total = document.getElementById("total");
var rVal = resourceVal.slice(1); //remove the "pound" sign
alert(rVal)
resourceVal = parseInt(rVal) //convert to a floating point number (with decimals)
//if its only integers, you can use "parseint(val)"
val += rVal; //add the values
alert (val)
total.value = '$' +val; <br/>
}
[code]
function setTotal(val) {
var resourceVal = document.getElementById("resource").value; //get the value
var total = document.getElementById("total");
var rVal = resourceVal.slice(1); //remove the "pound" sign
alert(rVal)
rVal = parseInt(rVal) //convert to a floating point number (with decimals)
//if its only integers, you can use "parseint(val)"
val += rVal; //add the values
alert (val)
total.value = '$' +val;
}
<i>
</i>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script></script>
<script type="text/javascript">
<!--
function resettoggle() {
var e = document.getElementById('extraFields');
e.style.display = 'none';
}
function toggle_visibility(id) {
var e = document.getElementById(id);
if(e.style.display == 'none')
e.style.display = 'block';
else
e.style.display = 'none';
}
function setResource (val) {
var resource = document.getElementById("resource"); //get the input field
val *= 400; //multiply the value by 400;
resource.value = "£" +val; //set the value
}
function setTotal(val) {
var resourceVal = document.getElementById("resource").value; //get the value
var total = document.getElementById("total");
var rVal = resourceVal.slice(1); //remove the "pound" sign
alert(rVal)
resourceVal = parseInt(rVal) //convert to a floating point number (with decimals)
//if its only integers, you can use "parseint(val)"
val += rVal; //add the values
alert (val)
total.value = '£' +val; <br/>
}
//-->
</script>
</head>
<body onLoad="resettoggle()">
<tr>
<td><div class="fieldlabel">Change Title:</div></td>
<td></td>
<td><textarea name="userstringvalue(1requestfctitle)" rows="2" class="datafield"></textarea></td>
<td></td>
<td><div class="errormsg"></div></td>
</tr>
<tr>
<td><div class="fieldlabel">Requested By:</div></td>
<td></td>
<td><textarea name="userstringvalue(2requestfcrequestor)" rows="1" class="datafield"></textarea></td>
<td></td>
<td><div class="errormsg"></div></td>
</tr>
<tr>
<td><div class="fieldlabel">HOTB:</div></td>
<td></td>
<td><textarea name="userstringvalue(3requestfcHOTB)" rows="1" class="datafield"></textarea></td>
<td></td>
<td><div class="errormsg"></div></td>
</tr>
<tr>
<td><div class="fieldlabel">Change Description:</div></td>
<td></td>
<td><textarea name="userstringvalue(4requestfcdesc)" rows="3" class="datafield"></textarea></td>
<td></td>
<td><div class="errormsg"></div></td>
</tr>
<tr>
<td><div class="fieldlabel">Required By Date:</div></td>
<td>
<a href="#" onClick="cal1.select(document.forms[0]['userstringvalue(5requestfcrequired)'],'anchor1','dd/MM/yy'); return false;" NAME="anchor1" ID="anchor1">
<img src="/assystEnterprise/shared/images/calendar.gif" border="0" hspace="0" vspace="0">
</a>
</td>
<td><textarea name="userstringvalue(5requestfcrequired)" rows="1" class="datafield"></textarea></td>
<td></td>
<td><div class="errormsg"></div></td>
</tr> <br/>
<tr>
<td><div class="fieldlabel">Total Man Days:</div></td>
<td></td>
<td> <textarea name="manDays" rows="1" class="datafield" onblur="setResource(this.value)"></textarea></td>
<td></td>
<td><div class="errormsg"></div></td>
</tr>
<tr>
<td>
<input type="text" id="resource" size="16">
<br>
</td>
</tr>
<i> </i> <tr>
<i> </i> <td><div class="fieldlabel">CapEx Cost (£):</div></td>
<i> </i> <td></td>
<i> </i> <td><textarea name="CapEx" rows="1" class="datafield" onblur="setTotal(this.value)"></textarea></td>
<i> </i> <td></td>
<i> </i> <td><div class="errormsg"></div></td>
<i> </i> <td>
<i> </i> <p>total cost
<i> </i> <input type="text" id="total" size="16">
<i> </i> <br>
<i> </i> </td>
<i> </i> </tr>
<i> </i> <a href="#" onclick="toggle_visibility('extraFields');">Click here if the Total Cost of Change is less than &pound;5k</a><br />
<i> </i> <div id="extraFields">
<i> </i> <tr>
<i> </i> <td colspan="5"><h3>If the Total Cost of Change is less than £5k, please complete the following fields...</h3></td>
<i> </i> <td></td>
<i> </i> </tr>
<i> </i> <tr>
<i> </i> <td><div class="fieldlabel">Reasons for Change:</div></td>
<i> </i> <td></td>
<i> </i> <td><textarea name="userstringvalue(8requestfcreasons)" rows="3" class="datafield"></textarea></td>
<i> </i> <td></td>
<i> </i> <td><div class="errormsg"></div></td>
<i> </i> </tr>
<i> </i> <tr>
<i> </i> <td><div class="fieldlabel">Known RIDAs:</div></td>
<i> </i> <td></td>
<i> </i> <td><textarea name="userstringvalue(9requestfcrida)" rows="3" class="datafield"></textarea></td>
<i> </i> <td></td>
<i> </i> <td><div class="errormsg"></div></td>
<i> </i> </tr>
<i> </i> <tr>
<i> </i> <td><div class="fieldlabel">Resource Requirements:</div></td>
<i> </i> <td></td>
<i> </i> <td><textarea name="userstringvalue(10requestfcresource)" rows="3" class="datafield"></textarea></td>
<i> </i> <td></td>
<i> </i> <td><div class="errormsg"></div></td>
<i> </i> </tr>
<i> </i> <tr>
<i> </i> <td><div class="fieldlabel">Additional Info:</div></td>
<i> </i> <td></td>
<i> </i> <td><textarea name="userstringvalue(11requestfcaddinfo)" rows="2" class="datafield"></textarea></td>
<i> </i> <td></td>
<i> </i> <td><div class="errormsg"></div></td>
<i> </i> </tr>
<i> </i> <tr><td colspan="5"><hr/></td></tr>
<i> </i> <tr>
<i> </i> <td colspan="5">
<i> </i> </div>
<i> </i> <br />
<i> </i> <tr>
<i> </i> <td colspan="56"><h3>If the Total Cost of Change is more than £5k, please attach a Project Brief to this request.<br><a title="Project Brief" href="file:///S:/!TBPM%20Templates/1.%20Selecting%20Business%20Change/Project%20Brief%20Template%20v1.0.doc" target="_blank">Click here</a> to view the Project Brief template from the <a title="Processes and Controls" href="http://nrfour/files/Intranet%20Spec%20V3.htm" target="_blank">Processes & Controls area</a> of the intranet.</h3></td>
<i> </i> <td></td>
<i> </i> </tr>
<i> </i> <br />
<i> </i> <input type="submit" name="LogEvent" value="Submit" onclick="setDispatchTarget('logEvent');" class="button">
</body>
</html>
[code=php]
var total = document.getElementById("total");
[/code]
[code=php]
var total = document.getElementById("total").value;
[/code]
<i>
</i>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script></script>
<script type="text/javascript">
<!--
function resettoggle() {
var e = document.getElementById('extraFields');
e.style.display = 'none';
}
function toggle_visibility(id) {
var e = document.getElementById(id);
if(e.style.display == 'none')
e.style.display = 'block';
else
e.style.display = 'none';
}
function setResource (val) {
var resource = document.getElementById("resource"); //get the input field
val *= 400; //multiply the value by 400;
resource.value = "£" +val; //set the value
}
function setTotal(val) {
var resourceVal = document.getElementById("resource").value; //get the value
var total = document.getElementById("total");
var rVal = resourceVal.slice(1); //remove the "pound" sign
alert(rVal)
rVal=parseInt(rVal) //convert to a floating point number (with decimals)
//if its only integers, you can use "parseint(val)"
val += rVal; //add the values
alert (val)
total.value = '£' +val;
}
//-->
</script>
</head>
<body onLoad="resettoggle()">
<tr>
<td><div class="fieldlabel">Change Title:</div></td>
<td></td>
<td><textarea name="userstringvalue(1requestfctitle)" rows="2" class="datafield"></textarea></td>
<td></td>
<td><div class="errormsg"></div></td>
</tr>
<tr>
<td><div class="fieldlabel">Requested By:</div></td>
<td></td>
<td><textarea name="userstringvalue(2requestfcrequestor)" rows="1" class="datafield"></textarea></td>
<td></td>
<td><div class="errormsg"></div></td>
</tr>
<tr>
<td><div class="fieldlabel">HOTB:</div></td>
<td></td>
<td><textarea name="userstringvalue(3requestfcHOTB)" rows="1" class="datafield"></textarea></td>
<td></td>
<td><div class="errormsg"></div></td>
</tr>
<tr>
<td><div class="fieldlabel">Change Description:</div></td>
<td></td>
<td><textarea name="userstringvalue(4requestfcdesc)" rows="3" class="datafield"></textarea></td>
<td></td>
<td><div class="errormsg"></div></td>
</tr>
<tr>
<td><div class="fieldlabel">Required By Date:</div></td>
<td>
<a href="#" onClick="cal1.select(document.forms[0]['userstringvalue(5requestfcrequired)'],'anchor1','dd/MM/yy'); return false;" NAME="anchor1" ID="anchor1">
<img src="/assystEnterprise/shared/images/calendar.gif" border="0" hspace="0" vspace="0">
</a>
</td>
<td><textarea name="userstringvalue(5requestfcrequired)" rows="1" class="datafield"></textarea></td>
<td></td>
<td><div class="errormsg"></div></td>
</tr> <br/>
<tr>
<td><div class="fieldlabel">Total Man Days:</div></td>
<td></td>
<td> <textarea name="manDays" rows="1" class="datafield" onblur="setResource(this.value)"></textarea></td>
<td></td>
<td><div class="errormsg"></div></td>
</tr>
<tr>
<td>
<input type="text" id="resource" size="16">
<br>
</td>
</tr>
<i> </i> <tr>
<i> </i> <td><div class="fieldlabel">CapEx Cost (£):</div></td>
<i> </i> <td></td>
<i> </i> <td><textarea name="CapEx" rows="1" class="datafield" onblur="setTotal(this.value)"></textarea></td>
<i> </i> <td></td>
<i> </i> <td><div class="errormsg"></div></td>
<i> </i> <td>
<i> </i> <p>total cost
<i> </i> <input type="text" id="total" size="16">
<i> </i> <br>
<i> </i> </td>
<i> </i> </tr>
<i> </i> <a href="#" onclick="toggle_visibility('extraFields');">Click here if the Total Cost of Change is less than &pound;5k</a><br />
<i> </i> <div id="extraFields">
<i> </i> <tr>
<i> </i> <td colspan="5"><h3>If the Total Cost of Change is less than £5k, please complete the following fields...</h3></td>
<i> </i> <td></td>
<i> </i> </tr>
<i> </i> <tr>
<i> </i> <td><div class="fieldlabel">Reasons for Change:</div></td>
<i> </i> <td></td>
<i> </i> <td><textarea name="userstringvalue(8requestfcreasons)" rows="3" class="datafield"></textarea></td>
<i> </i> <td></td>
<i> </i> <td><div class="errormsg"></div></td>
<i> </i> </tr>
<i> </i> <tr>
<i> </i> <td><div class="fieldlabel">Known RIDAs:</div></td>
<i> </i> <td></td>
<i> </i> <td><textarea name="userstringvalue(9requestfcrida)" rows="3" class="datafield"></textarea></td>
<i> </i> <td></td>
<i> </i> <td><div class="errormsg"></div></td>
<i> </i> </tr>
<i> </i> <tr>
<i> </i> <td><div class="fieldlabel">Resource Requirements:</div></td>
<i> </i> <td></td>
<i> </i> <td><textarea name="userstringvalue(10requestfcresource)" rows="3" class="datafield"></textarea></td>
<i> </i> <td></td>
<i> </i> <td><div class="errormsg"></div></td>
<i> </i> </tr>
<i> </i> <tr>
<i> </i> <td><div class="fieldlabel">Additional Info:</div></td>
<i> </i> <td></td>
<i> </i> <td><textarea name="userstringvalue(11requestfcaddinfo)" rows="2" class="datafield"></textarea></td>
<i> </i> <td></td>
<i> </i> <td><div class="errormsg"></div></td>
<i> </i> </tr>
<i> </i> <tr><td colspan="5"><hr/></td></tr>
<i> </i> <tr>
<i> </i> <td colspan="5">
<i> </i> </div>
<i> </i> <br />
<i> </i> <tr>
<i> </i> <td colspan="56"><h3>If the Total Cost of Change is more than £5k, please attach a Project Brief to this request.<br><a title="Project Brief" href="file:///S:/!TBPM%20Templates/1.%20Selecting%20Business%20Change/Project%20Brief%20Template%20v1.0.doc" target="_blank">Click here</a> to view the Project Brief template from the <a title="Processes and Controls" href="http://nrfour/files/Intranet%20Spec%20V3.htm" target="_blank">Processes & Controls area</a> of the intranet.</h3></td>
<i> </i> <td></td>
<i> </i> </tr>
<i> </i> <br />
<i> </i> <input type="submit" name="LogEvent" value="Submit" onclick="setDispatchTarget('logEvent');" class="button">
</body>
</html>
0.1.9 — BETA 6.2