Results 1 to 2 of 2

Thread: Forms

  1. #1
    Kris Bailey Guest

    Default Forms

    I have this order request form I created. On this order request form I have a "qty" field, "ApproxCost" field and "ApproxTotal field which are all textboxes. What I want to be able to do is, while the user is inputting the quantity and the approximate cost for the item, I want the "ApproxTotal" Textbox Value to change to the result of what the user inputs. Is this possible and how? Can someone give me an example? Thanks!

  2. #2
    Join Date
    Dec 1969

    Default RE: Forms

    This doesn&#039t involve asp, it uses javascript. You would use the onKeyPress(function()) comand. The way to do this is as follows:<BR><BR>first write the function in the head in between javascript tags:<BR>&#060;script language=javascript&#062;<BR>function addUp()<BR>{<BR>t1=document.form1.t1.value<BR>t2=d ocument.form1.t2.value<BR>total=(t1+t2)<BR>documen<BR>}<BR>&#060;/script&#062;<BR><BR>Then in your text box tags:<BR><BR>&#060;form action=alkdj.asp method=post name=form1&#062;<BR>&#060;input type=text name=t1 onKeypress="AddUp()"&#062;<BR>&#060;input type=text name=t2 onKeypress="AddUp()"&#062;<BR>&#060;input type=text name=total&#062;<BR><BR><BR>Give it a try. There are no guarentees that it will work. Javascript is not my best skill and there are likely to be little stupid errors like caps and what not.<BR><BR>Good Luck<BR>Brandon<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts