473,385 Members | 1,821 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How can I plus the value

Hello,
I wrote this code:

<SCRIPT LANGUAGE=VBScript RUNAT=Server>
dim ab
ab=0
Response.Write "<INPUT type=""text"" id=customername name=customername
onchange=""ab=ab+1"" value=""abc"">"
Response.Write "<BR>"
Response.Write "<INPUT type=""text"" id=text1 name=text1 value =" & ab &
">"
....
</SCRIPT>

But onchange the customername's text ,ab's value was no plus.Can you help
me.

Jul 19 '05 #1
2 1485
Jack wrote:
Hello,
I wrote this code:

<SCRIPT LANGUAGE=VBScript RUNAT=Server>
dim ab
ab=0
Response.Write "<INPUT type=""text"" id=customername
name=customername onchange=""ab=ab+1"" value=""abc"">"
Response.Write "<BR>"
Response.Write "<INPUT type=""text"" id=text1 name=text1 value =" &
ab & ">"
...
</SCRIPT>

But onchange the customername's text ,ab's value was no plus.Can you
help me.


Your problem is lack of understanding where the code is executing.

Everything in the script block runs at the server. That means the variable
you declared in that script block is only visible to the code that is
running on the server.

The onchange event takes place at the client. The code running on the client
machine has no idea about any variables that were declared in the
server-side code.. You will need to write some client-side code to declare a
client-side variable in the window's onload event, along with code in the
INPUT's onchange event to display the new value for ab when it gets changed.

You should follow up on a client-side coding newsgroup (look for one with
"dhtml" in its name, or go to m.p.scripting.vbscript or
m.p.scripting.jscript)

HTH,
Bob Barrows

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 19 '05 #2
Thank you!
But I don't know how can I do.
Can you give me a simple sample.

Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Gerry Viator | last post by:
Hi all, I have a textbox were a time is typed in like: upto 4 numbers 1900 300 1000 1425 I would like as they type the text to show todays date plus the time they
4
by: r0adh0g | last post by:
I am attempting to build a primitive search form on my site. It is searching an Access Database Table and comparing on field in the database to a field passed from the form. Works great if only...
1
by: Jacob Grydholt Jensen | last post by:
I am trying to learn iSQL*Plus for the 1Z0-007 exam. I am having a bit of problems with the substitution variables. My understanding was that they behave as in SQL*Plus, but my experiments beg to...
3
by: Peter | last post by:
Has anyone seen this before? I start SQL*Plus, and login by typing sqlplus Quantum/Password@BPrd I type: select '&1' from dual; it responds
6
by: RobG | last post by:
I am writing a script to move an absolutely positioned element on a page by a factor using style.top & style.left. The amount to move by is always some fraction, so I was tossing up between...
0
by: Emil Georgiev | last post by:
Hell I have a Web Custom Control project in ASP.NET. I'm using a subclassing technique to add functionality in HyperLink web server control. I want to create a property "BrowserWindow" of my...
1
by: qwerty | last post by:
My end goal is to have a script that takes user input from one pageA, submits to pageB which then displays the parameter values entered on PageA. My problem is that the values are being displayed...
2
by: thavaht | last post by:
I made a link in a dynamic table on a master page to find details of a selected record and display on a detail page, using URL parameter values retrieved from the selected record. <td><a...
1
by: Gene Kelley | last post by:
This has got to be an easy one, but I'm just not getting it. The following function (below) returns name=value pairs from URL queries (GET). All is working as expected, but I am trying to figure...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.