473,376 Members | 981 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,376 software developers and data experts.

text field besides the input tag

Is there a text field tag with a value parameter that I can refer to
with Javascript besides the input tag?

What I have been doing is using Ajax and PHP to pull data out of a
database. Then with Javascript I have been filling the value of an
input text field with with that data. The input text field has its
border styled off so it looks just like text.

Is there a cleaner way of doing this?
Jun 27 '08 #1
4 3024
Gazing into my crystal ball I observed David Tay <da*********@gmail.com>
writing in news:0b0f7df5-6989-4221-bddf-7878eb4f5f92
@m45g2000hsb.googlegroups.com:
Is there a text field tag with a value parameter that I can refer to
with Javascript besides the input tag?

What I have been doing is using Ajax and PHP to pull data out of a
database. Then with Javascript I have been filling the value of an
input text field with with that data. The input text field has its
border styled off so it looks just like text.

Is there a cleaner way of doing this?
<form method="post" action="action">
<div>
<label for="field" id="field1">Field</label<input type="text"
name="name" id="field" value="recordset.value">
<input type="submit" value="Submit">
</div>
</form>

You can style the label element and refer to it in script.

--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share

Jun 27 '08 #2
David Tay wrote:
Is there a text field tag with a value parameter that I can refer to
with Javascript besides the input tag?

What I have been doing is using Ajax and PHP to pull data out of a
database. Then with Javascript I have been filling the value of an
input text field with with that data. The input text field has its
border styled off so it looks just like text.

Is there a cleaner way of doing this?
It's tricky to respond to a person who says what he is doing rather than
stating what he is trying to accomplish--*why* he is doing it. I'm
inferring that (a) you want the data to appear as text on the screen and
(b) you also want it to be submitted along with other data from a form.

The proper approach is (a) to display it as ordinary text where you want
it to appear as ordinary text and (b) also to include a *hidden* input
element on the form with the required data as its value.
Jun 27 '08 #3
No, you haven't bothered to explain why these items need *both* (a) to
look like text and yet (b) function is input fields.
Obviously you have trouble with reading English.
The code you have seems to accomplish what it is you want superficially
Yeah, whatever you say.
Jun 27 '08 #4
David Tay wrote:
>No, you haven't bothered to explain why these items need *both* (a) to
look like text and yet (b) function is input fields.

Obviously you have trouble with reading English.
Obviously you're an ingrate.
>
>The code you have seems to accomplish what it is you want superficially

Yeah, whatever you say.
<plonk>
Jun 27 '08 #5

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

Similar topics

3
by: Mark | last post by:
Hi, Im trying to validate a form, all the validating works apart from one field. This particular field must consist of the first 2 characters as letters, & the following 5 as numbers. And if it...
14
by: jlemay | last post by:
if you look at http://www.emrose.net/contact1.html the last field is a textarea field and I can't make it align with the other text fields. it's pretty close, but this comes from trial and...
2
by: henrywuxg | last post by:
Hi All, I would like to use Period Key(.) besides Tab to toggle from one textbox to another when user is editing IP addresses, which have four textboxes. The function in below works fine with...
1
by: abracad_1999 | last post by:
I have created a very simple form <form name="form1" method="post" action="" style="font-size:0.75em;"> e-mail <input type="text" name="textfield" size="15"> &nbsp;&nbsp;password <input...
0
by: hcuellar | last post by:
Hi. Please I need your help for this: After a database query, a table is created with a cell for each information retrieved, and for each record, two buttons, and second one have besides it...
5
by: Yohan Blurp | last post by:
Hi, Here is sample page to show you the problem : <html><body> <form action="/cgi-bin/test.cgi" method="post"> Data Path : <input type="text" size="50" value="C:\Test Data\May 2007.xls"...
9
by: plumba | last post by:
Hi all I have a pretty cool script which, on the click of a button, sticks in a extra text box and gives it a unique name/id so it can be munipulated and sent through on a form. Problem is, I...
11
by: Mike Harrison | last post by:
Hi, I have some simple HTML like this: <div id="container" style="width:100%;"> <input type="text" <input type="button" style="float:right;" value="Click here..."> </div> I want the button...
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.