473,385 Members | 1,154 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.

Getting the value of javascript inputbox into a textfield

Hi,

First of all, i wanna say i don't have a great knowledge about javascript.

So, what i want to do is this:

If a user press a button, a inputbox shows up. Untill here, no problem but now i want to put what that person entered in a textbox so i can use the texbox value.

I am programming in ASP (not ASP.NET!!!). I used javascript to call the inputbox. I have no idea how to gow further now.

Thank you in advance.

Xzorius.
Apr 3 '07 #1
3 4724
acoder
16,027 Expert Mod 8TB
Welcome to TSDN!

Assuming you have:
Expand|Select|Wrap|Line Numbers
  1. var resp = prompt(...
and [HTML]<input type="text" name="textname" id="textid" ...>[/HTML] then to set the value of the textbox:
Expand|Select|Wrap|Line Numbers
  1. document.getElementById("textid").value=resp;
(These are only test names/ids - use whatever you are comfortable with)
Apr 4 '07 #2
Welcome to TSDN!

Assuming you have:
Expand|Select|Wrap|Line Numbers
  1. var resp = prompt(...
and [HTML]<input type="text" name="textname" id="textid" ...>[/HTML] then to set the value of the textbox:
Expand|Select|Wrap|Line Numbers
  1. document.getElementById("textid").value=resp;
(These are only test names/ids - use whatever you are comfortable with)
OMG so simple. Thanks alot m8, realy needed that code. ^^

I was trying like

Expand|Select|Wrap|Line Numbers
  1. txt.value=resp;
or

Expand|Select|Wrap|Line Numbers
  1. txt*.text=resp;
Apr 6 '07 #3
acoder
16,027 Expert Mod 8TB
Glad I could be of help.
Apr 9 '07 #4

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

Similar topics

20
by: MLH | last post by:
120 MyString = "How many copies of each letter do you need?" 150 MyVariant = InputBox(MyString, "How Many?", "3") If MyVariant = "2" Then MsgBox "MyVariant equals the string '2'" If...
1
by: platostoteles | last post by:
Hallo NG, I am new to JavaScript and would really appreciate any help to solve my problem. I am using the blow code in my form to validate form fields. What I would like to accomplish is that...
1
by: empiresolutions | last post by:
Hello fellow code junkies, I am using the "Ajax dynamic list" http://dhtmlgoodies.com/index.html?whichScript=ajax-dynamic-list and i think its the best out there. I have found a compatibility...
12
chunk1978
by: chunk1978 | last post by:
hi there... i'd like to know if it's possible to copy a selected file's name (value?) and insert it into a basic text field thru an onchange event handler... here is my code: <!DOCTYPE html...
1
by: macintoshhondo | last post by:
Hi ! i am a newbie and dont know javascript much. what i really need is a simple javascript code that can insert number in the value section of the different forms from the one form. FORM 1:...
1
by: prathna | last post by:
Hi all, I would like to know how to pass a form bean value to javascript function to perform some validation.. I have a dropdown list and a textfield. I have created the dropdown list using...
22
by: printline | last post by:
Hello All I have a script where i need to show the value of a text field in another textfield/field. I have done the same with my radio buttons and select fields like this: <script...
4
by: Michael Munch | last post by:
Hi I want to read the value of af text-field, create dynamic, in a form. Se below a small test-site to do that (but readning fails): I use the function Test_Read for reading the value from the...
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
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
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:
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.