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

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

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


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

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