-
input box info to variables
I am trying to make a simple web site which takes information entered into
an input box then manipulates it into a calculated value.
I have tried the followin line:
<p>Amount which should have been paid on the above date? $<INPUT TYPE="text"
NAME="txtDamageAmount" SIZE="8"
VALUE="0.00" TABINDEX="1" WIDTH="107" HEIGHT="21" STYLE="font-size:
10pt">
</p>
Then using VBscript I attempt to call for the values inputed into this box
to make a calculation. for example intPenAmount = txtDamageAmount x 5
I then want to display that value in a different text box after some calculations
have been completed.
Document.frmCF.txtPenAmount.Value = intPenAmount
(form name = frmCF)
Is this the correct format?
I have not been able to get this to work.
-
Re: input box info to variables
Your syntax for getting the value is from JavaScript. If you are using VBScript
(assuming .asp pages, otherwise your excluding NN browsers)
intPenAmount = cInt(request.form("txtDamageAmount")) * 5
Then to dynamically update the field write your text field as below and have
this code on the page...
if intPenAmount <> "" then
intTotal = intPenAmount
else
intTotal = "0.00"
end if
<INPUT TYPE="text" NAME="txtDamageAmount" SIZE="8" VALUE="<%= intTotal >">
"ken" <kendorsey@attbi.com> wrote:
>
>I am trying to make a simple web site which takes information entered into
>an input box then manipulates it into a calculated value.
>I have tried the followin line:
><p>Amount which should have been paid on the above date? $<INPUT TYPE="text"
>NAME="txtDamageAmount" SIZE="8"
> VALUE="0.00" TABINDEX="1" WIDTH="107" HEIGHT="21" STYLE="font-size:
>10pt">
> </p>
>Then using VBscript I attempt to call for the values inputed into this box
>to make a calculation. for example intPenAmount = txtDamageAmount x 5
>
>I then want to display that value in a different text box after some calculations
>have been completed.
>
>Document.frmCF.txtPenAmount.Value = intPenAmount
> (form name = frmCF)
>Is this the correct format?
>I have not been able to get this to work.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks