input box info to variables


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: input box info to variables

  1. #1
    ken Guest

    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.

  2. #2
    Michael Guest

    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
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center