473,395 Members | 1,541 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,395 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 3026
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...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.