473,322 Members | 1,431 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,322 software developers and data experts.

Textbox variable help

I am a beginner and would like to know how to make the variable "add" something you input into this script via a textbox. Any help would be much appreciated. Thanks.

Expand|Select|Wrap|Line Numbers
  1. function replaceChars(entry) {
  2. out = "xxxx"; 
  3. add = "z"; // I don't want z to be "add," I want that to be user inputted
  4. temp = "" + entry;
  5.  
  6. while (temp.indexOf(out)>-1) {
  7. pos= temp.indexOf(out);
  8. temp = "" + (temp.substring(0, pos) + add + 
  9. temp.substring((pos + out.length), temp.length));
  10. }
  11. document.subform.text.value = temp;
  12. }
  13.  
Feb 23 '07 #1
1 1119
acoder
16,027 Expert Mod 8TB
Declare a text input in a form:
[HTML]<form id="myform" ...>
<input type="text" id="mytext" name="mytext" value="">[/HTML]
then access it using
Expand|Select|Wrap|Line Numbers
  1. document.getElementById("mytext").value
Feb 23 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Suresh Kumaran | last post by:
Hi All, Does anybody know the sytax in VB.NET to write the contents of a multiline text box to a text file? Appreciate help. Suresh
6
by: Ketta | last post by:
I know how to read a file system object and output it to the browser page. The desired result would be to put that file into a textbox on the screen for a user to modify and then write the file...
2
by: Ant | last post by:
Ok, so I have a regular input textbox on my webpage and I'm trying to work out how to make it so when the user presses a button the the textbox holds the value of a variable. I just can't work out...
12
by: Gene Hubert | last post by:
How do I make a TextBox behave like the address bar in IE? That is... If focus is not on the tb, select all text if clicking on the tb or tabbing into the tb. Clicking again deselects the text...
19
by: hamil | last post by:
I have a form with one button, Button1, and a Textbox, Textbox1 I have a class, class1 as follows. Public Class Class1 Public DeForm As Object Sub doit() DeForm.Textbox1.text = "It works"...
7
by: nospam | last post by:
Hello All, Is it possible to place a variable inside of a textbox and have it viewed as the value? Or even read in as a string. Here's the problem... I have a text file I would like to read in...
7
by: david | last post by:
I try to use "for" loop to assign textbox control ID to a textbox variable in server side codebehind for a web form. But I met some problem. What I want to do is solving the following-like code by...
14
by: ZaphodBBB | last post by:
Hi O.S. = Windows XP Pro all Service Packs Access = 2003 I have a form with 2 tabbed pages. On the second page I have a subform which populates in Datasheet view with a list of items. One...
3
by: Mike | last post by:
Is there a way to determine if a user deleted text in a asp:textbox? I have a textbox were users can enter in a product number, then they click a button to see if the product numbers(s) exists in...
2
by: jd | last post by:
I have several textboxes in which the end user can enter values. When the user presses the Enter key when in any of the textboxes, or leaves that textbox, I want a routine to run (mathematical...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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...

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.