Login or Sign up Help | Site Map
Connecting Tech Pros Worldwide

text field besides the input tag

Question posted by: David Tay (Guest) on June 27th, 2008 07:16 PM
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?
Would you like to answer this question?
Sign up for a free account, or Login (if you're already a member).
Adrienne Boswell's Avatar
Adrienne Boswell
Guest
n/a Posts
June 27th, 2008
07:16 PM
#2

Re: text field besides the input tag
Gazing into my crystal ball I observed David Tay <david.tay20@gmail.com>
writing in news:0b0f7df5-6989-4221-bddf-7878eb4f5f92
@m45g2000hsb.googlegroups.com:
Quote:
Originally Posted by
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


Harlan Messinger's Avatar
Harlan Messinger
Guest
n/a Posts
June 27th, 2008
07:16 PM
#3

Re: text field besides the input tag
David Tay wrote:
Quote:
Originally Posted by
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.

David Tay's Avatar
David Tay
Guest
n/a Posts
June 27th, 2008
07:16 PM
#4

Re: text field besides the input tag
No, you haven't bothered to explain why these items need *both* (a) to
Quote:
Originally Posted by
look like text and yet (b) function is input fields.


Obviously you have trouble with reading English.
Quote:
Originally Posted by
The code you have seems to accomplish what it is you want superficially


Yeah, whatever you say.

Harlan Messinger's Avatar
Harlan Messinger
Guest
n/a Posts
June 27th, 2008
07:16 PM
#5

Re: text field besides the input tag
David Tay wrote:
Quote:
Originally Posted by
Quote:
Originally Posted by
>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.
Quote:
Originally Posted by
>
Quote:
Originally Posted by
>The code you have seems to accomplish what it is you want superficially

>
Yeah, whatever you say.


<plonk>

 
Not the answer you were looking for? Post your question . . .
182,318 Experts ready to help you find a solution.
Sign up for a free account, or Login (if you're already a member).

  • Didn't find the answer you were looking for?
    Post Your Question
  • Top Community Contributors