471,311 Members | 1,761 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,311 software developers and data experts.

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 2459
"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 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.