View Full Version : How to math calculate between 2 values which is input from 2 textfiled
fractalvibes
03-12-2005, 03:50 AM
What the **** are you asking for? Perhaps you might rephrase into something coherant....
You have two text fields and want to do what?
fv
<tr>
<td><input type="text" name="txtNewIndex" size="fill" value="<%=request.Form("txtNewIndex")%>"></td>
<td><input type="text" name="txtLastIndex" size="fill" value="<%=request.Form("txtLastIndex")%>"></td>
<td><input type="text" name="txtUsed" size="fill"> ***
</td>
<td><% = rsData("SupplierUnitPrice")%></td>
</tr>
I have 2 text filed like that txtNewIndex and txtlastIndex, i will input 2 number into that forms.
I want to know how can see the result of " txtNewIndex - txtlastIndex " in txtUsed.
thanks in advance.
ghell
03-14-2005, 08:39 AM
<tr>
<td><input type="text" name="txtNewIndex" size="fill" value="<%=Request.Form("txtNewIndex")%>"></td>
<td><input type="text" name="txtLastIndex" size="fill" value="<%=Request.Form("txtLastIndex")%>"></td>
<td><input type="text" name="txtUsed" size="fill" value="<%=Request.Form("txtNewIndex") - Request.Form("txtLastIndex")%>"> ***</td>
<td><%=rsData("SupplierUnitPrice")%></td>
</tr>use code blocks please!
i have never seen size="fill" before :confused:
<tr>
<td><input type="text" name="txtNewIndex" size="fill" value="<%=Request.Form("txtNewIndex")%>"></td>
<td><input type="text" name="txtLastIndex" size="fill" value="<%=Request.Form("txtLastIndex")%>"></td>
<td><input type="text" name="txtUsed" size="fill" value="<%=Request.Form("txtNewIndex") - Request.Form("txtLastIndex")%>"> ***</td>
<td><%=rsData("SupplierUnitPrice")%></td>
</tr>use code blocks please!
i have never seen size="fill" before :confused:
Code block ?? i dont know about this, im beginner.
size = "fill" will make a text filed auto fit with a column's width
ghell
03-14-2005, 08:48 AM
code blocks:
[code|
.....
[/code|
its just the thing on here that keeps code formatting like i posted just now
Code:
.......
i would use size="100%" to make it fit, or style="width: 100%;" *shrugs* that wasnt your question anyway, its just i had never seen it used
I try that code but i can not see the result ???
i input 100 in txtNewIndex
50 in txtLastIndex
then in a 3rd column i want to see 50.
I need to assign any variable????
fractalvibes
03-14-2005, 03:27 PM
Sounds like you may want to do this client-side using javascript. Otherwise, to do in ASP, you will have to post back to the server to add the two fields the user entered, in VBScript.
fv
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.