hi guys, just want to ask if how can i display the value of the textbox in javascript? as in, i will output it
xuexue
15
Junior Poster
Recommended Answers
Jump to Postare you wanting to access the text server side or client side?
A simple clientside access is using javascript. First, the textbox must have a unique id. Then the easiest way to access it is like this:
var boxtext = document.getElementById('uniqueid').value;
Jump to Postphp is serverside so it can only be sent using a GET or POST method. This can either be done with forms or with AJAX scripting.
why do you want to send the value to php?
Jump to Postit is probably best to put the text input inside a form and submit it. I'm not sure why you would have any problems using a submit button... but obviously submitting a form will cause a new page to load. Is that your problem - you can't have the page …
Jump to PostI'm trying to help but I'm not sure what your problem is so I don't know what type of coding you need. If you need help making a form, it's pretty simple.
<form action="page.php" method="POST"> <input type="text" name="text1" id="text1" /> <input type="submit" /> </form>
that will submit …
All 14 Replies
ambius
0
Newbie Poster
xuexue
15
Junior Poster
ambius
0
Newbie Poster
xuexue
15
Junior Poster
ambius
0
Newbie Poster
xuexue
15
Junior Poster
ambius
0
Newbie Poster
xuexue
15
Junior Poster
muralibobby2015
17
Posting Pro

diafol
ambius
0
Newbie Poster
K0ns3rv
0
Junior Poster in Training

diafol
xuexue
15
Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.