B
bill yeager
I tried placing the following logic in my page_load event
to handle the client-side jhavascript needed to add the
first 2 textboxes to the total:
<code>
txtMileageBeginning.Attributes.Add("onChange", "ChkMileage
(document.getElementById('" &
txtMileageBeginning.ClientID & "'),
document.getElementById('" & txtEnding.ClientID & "'),
document.getElementById('" & txtTotal.ClientID & "');")
txtEnding.Attributes.Add("onChange", "ChkMileage
(document.getElementById('" &
txtMileageBeginning.ClientID & "'),
document.getElementById('" & txtEnding.ClientID & "'),
document.getElementById('" & txtTotal.ClientID & "');")
Dim sbChkMileage As New StringBuilder
sbChkMileage.Append("<SCRIPT
language='javascript'>")
sbChkMileage.Append("function ChkMileage
(objTextBox1, objTextBox2, objTextBox3) { ")
sbChkMileage.Append("if(objTextBox1.value.length
(objTextBox3).value == objTextBox1.value +
objTextBox2.value)}")
sbChkMileage.Append("</SCRIPT>")
RegisterStartupScript
("PageStartupScriptChkMileage", sbChkMileage.ToString)
sbChkMileage = Nothing
</code>
When I'm debugging and view the source code, I get the
following in the View Source:
<code>
onChange="ChkMileage(document.getElementById
('txtMileageBeginning'), document.getElementById
('txtEnding'), document.getElementById('txtTotal');
<SCRIPT language='javascript'>function ChkMileage
(objTextBox1, objTextBox2, objTextBox3) { if
(objTextBox1.value.length > 0 && objTextBox2.value.length
</code>
While also debugging, there was no "running document"???
What am I doing wrong, because the javascript is not
firing after I place values in the first two textboxes???
to handle the client-side jhavascript needed to add the
first 2 textboxes to the total:
<code>
txtMileageBeginning.Attributes.Add("onChange", "ChkMileage
(document.getElementById('" &
txtMileageBeginning.ClientID & "'),
document.getElementById('" & txtEnding.ClientID & "'),
document.getElementById('" & txtTotal.ClientID & "');")
txtEnding.Attributes.Add("onChange", "ChkMileage
(document.getElementById('" &
txtMileageBeginning.ClientID & "'),
document.getElementById('" & txtEnding.ClientID & "'),
document.getElementById('" & txtTotal.ClientID & "');")
Dim sbChkMileage As New StringBuilder
sbChkMileage.Append("<SCRIPT
language='javascript'>")
sbChkMileage.Append("function ChkMileage
(objTextBox1, objTextBox2, objTextBox3) { ")
sbChkMileage.Append("if(objTextBox1.value.length
sbChkMileage.Append("getElementById0 && objTextBox2.value.length > 0 && document.")
(objTextBox3).value == objTextBox1.value +
objTextBox2.value)}")
sbChkMileage.Append("</SCRIPT>")
RegisterStartupScript
("PageStartupScriptChkMileage", sbChkMileage.ToString)
sbChkMileage = Nothing
</code>
When I'm debugging and view the source code, I get the
following in the View Source:
<code>
onChange="ChkMileage(document.getElementById
('txtMileageBeginning'), document.getElementById
('txtEnding'), document.getElementById('txtTotal');
<SCRIPT language='javascript'>function ChkMileage
(objTextBox1, objTextBox2, objTextBox3) { if
(objTextBox1.value.length > 0 && objTextBox2.value.length
objTextBox1.value + objTextBox2.value)}</SCRIPT>0 && document.getElementById(objTextBox3).value ==
</code>
While also debugging, there was no "running document"???
What am I doing wrong, because the javascript is not
firing after I place values in the first two textboxes???