468,535 Members | 1,671 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,535 developers. It's quick & easy.

Accessing an input value when it is not within <form></form> - how?

I have the following code:

<input type="text" name="search" class="search_top"> <a href=""
onclick="window.location='search.inc.php'+document .[what-goes-here?].search.
value; return false;" class="search_top">go</a>

What do I put within [] to access the value of the input field search so I
can access it's value?

Thanks,

Keiron
Jul 20 '05 #1
2 2370
"Keiron Waites" <we*******@sharemonkey.com> wrote:
I have the following code:
What does this have to do with stylesheets?
<input type="text" name="search" class="search_top"> <a href=""
onclick="window.location='search.inc.php'+documen t.[what-goes-here?].search.
value; return false;" class="search_top">go</a>
And what happens when the user doesn't have JavaScript?

Put the input inside a form.
Rewrite search.inc.php so it works with standard form data.
Use a submit button.
What do I put within [] to access the value of the input field search so I
can access it's value?


Give the the input an id.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #2
Shit sorry, that's what happens when you work late at night.
"Steve Pugh" <st***@pugh.net> wrote in message
news:o1********************************@4ax.com...
"Keiron Waites" <we*******@sharemonkey.com> wrote:
I have the following code:


What does this have to do with stylesheets?
<input type="text" name="search" class="search_top"> <a href=""


onclick="window.location='search.inc.php'+documen t.[what-goes-here?].search

..
value; return false;" class="search_top">go</a>


And what happens when the user doesn't have JavaScript?

Put the input inside a form.
Rewrite search.inc.php so it works with standard form data.
Use a submit button.
What do I put within [] to access the value of the input field search so Ican access it's value?


Give the the input an id.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>

Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Ricki Susic | last post: by
4 posts views Thread by Howard Jess | last post: by
10 posts views Thread by Phlip | last post: by
19 posts views Thread by Coward 9 | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.