471,337 Members | 1,081 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,337 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 2951
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by abracad_1999 | last post: by
5 posts views Thread by Yohan Blurp | last post: by
11 posts views Thread by Mike Harrison | last post: by
reply views Thread by rosydwin | last post: by

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.