text box value in asp

Please support our ASP advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
Reply

Join Date: Jul 2006
Posts: 2
Reputation: kdv is an unknown quantity at this point 
Solved Threads: 0
kdv kdv is offline Offline
Newbie Poster

text box value in asp

 
0
  #1
Jul 17th, 2006
hi plz tell me how to increment textbox value by 1 whenever click submit button in asp.Example let say now my text box value is 1.When user click submit the text box value must change to 2 and so on.Plz reply me. thanx in advance
Reply With Quote Quick reply to this message  
Join Date: Jul 2006
Posts: 6
Reputation: terrencetaylor7 is an unknown quantity at this point 
Solved Threads: 0
terrencetaylor7 terrencetaylor7 is offline Offline
Newbie Poster

Re: text box value in asp

 
0
  #2
Jul 21st, 2006
oops...
Last edited by terrencetaylor7; Jul 21st, 2006 at 1:14 pm.
Reply With Quote Quick reply to this message  
Join Date: Jul 2006
Posts: 6
Reputation: terrencetaylor7 is an unknown quantity at this point 
Solved Threads: 0
terrencetaylor7 terrencetaylor7 is offline Offline
Newbie Poster

Re: text box value in asp

 
0
  #3
Jul 21st, 2006
sorry, continued.
  1. <script language="JavaScript">
  2. function addone(){
  3. textbox1.value=eval(textbox1.value + 1)
  4. form1.submit()
  5. }</script>
[html]
<form method="post" action="somepage.asp" onSubmit="addone()"><input type="text" name="textbox1"><input type="submit" value="submit"></form>[/html]

Or more like:
  1. <script language="JavaScript">
  2. function addone(){
  3. textbox1.value=eval(textbox1.value + 1)
  4. }</script>
[html]
<input type="text" name="textbox1"><input type="Button" value="submit" onClick="addone()"></form>[/html]
Reply With Quote Quick reply to this message  
Join Date: Jul 2006
Posts: 2
Reputation: kdv is an unknown quantity at this point 
Solved Threads: 0
kdv kdv is offline Offline
Newbie Poster

Re: text box value in asp

 
0
  #4
Jul 21st, 2006
Originally Posted by terrencetaylor7
sorry, continued.
  1. <script language="JavaScript">
  2. function addone(){
  3. textbox1.value=eval(textbox1.value + 1)
  4. form1.submit()
  5. }</script>
[html]
<form method="post" action="somepage.asp" onSubmit="addone()"><input type="text" name="textbox1"><input type="submit" value="submit"></form>[/html]

Or more like:
  1. <script language="JavaScript">
  2. function addone(){
  3. textbox1.value=eval(textbox1.value + 1)
  4. }</script>
[html]
<input type="text" name="textbox1"><input type="Button" value="submit" onClick="addone()"></form>[/html]
Hi thanx for ur response.Its really helpful.But now I,m facing another problem.Im having one combobox.Once user choose item in combobox, the selected item must be display in textbox with an autonumber.For example:
If combobox value is A.textbox value must be A1.Once user submit,and user choose another item in combobox the item (let say B) textbox must display B2.hope u understand my question.Thanx in advance.Plz post me as soon as possible.Because I need to finish tis function as earlier as possible.
Reply With Quote Quick reply to this message  
Join Date: Jul 2006
Posts: 6
Reputation: terrencetaylor7 is an unknown quantity at this point 
Solved Threads: 0
terrencetaylor7 terrencetaylor7 is offline Offline
Newbie Poster

Re: text box value in asp

 
0
  #5
Jul 22nd, 2006
I think this will do it. Tell me what you think...
[html]
<html><head>
<script language="JavaScript">
function addone(){
form1.counter1.value=eval(form1.counter1.value) + 1
form1.submit()
}</script>
</head><body>
<%
countsofar = CInt(Request("counter1"))
ddselected = CStr(Request("dropdown1"))
textbox1now = ddselected & countsofar
%>
<form method="post" action="test.asp" name="form1">
<select name="dropdown1">
<option value="a" <%if ddselected="a" then response.write("selected") end if%>>a</option>
<option value="b" <%if ddselected="b" then response.write("selected") end if%>>b</option>
<option value="c" <%if ddselected="c" then response.write("selected") end if%>>c</option>
</select>
<input type="text" name="textbox1" value="<%=textbox1now%>">
<input type="hidden" name="counter1" value="<%=countsofar%>">
<input type="button" value="submit" onClick="addone()">
</form>
</body></html>
[/html]
Last edited by terrencetaylor7; Jul 22nd, 2006 at 9:41 am.
Reply With Quote Quick reply to this message  
Join Date: Jul 2006
Posts: 1
Reputation: bala_friendd is an unknown quantity at this point 
Solved Threads: 0
bala_friendd bala_friendd is offline Offline
Newbie Poster

Re: text box value in asp

 
0
  #6
Jul 26th, 2006
[quote=kdv]hi plz tell me how to increment textbox value by 1 whenever click submit button in asp.Example let say now my text box value is 1.When user click submit the text box value must change to 2 and so on.Plz reply me. thanx in advance[/quote


iam sending the coding copy pste in ur applcation

function ChkZero(x) { if(x == "") return 0; else return x; }
function calc(el1,el2,el3,el4) { var a = ChkZero(eval("document.frmansadd."+el1).value); var b = ChkZero(eval("document.frmansadd."+el2).value); var c = ChkZero(eval("document.frmansadd."+el3).value); d = parseInt(a)+parseInt(b)+parseInt(c) eval("document.frmansadd."+el4).value=d; }
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the ASP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC