By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,688 Members | 1,936 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,688 IT Pros & Developers. It's quick & easy.

text field besides the input tag

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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.