I know this must be simple, but I need a little help as this isn't my area.
I have a search box called searchText and a search button called
searchButton. If a user puts "foo" in the text box and clicks the search
button, I want this to change pages with "foo" as a parameter. Sort of go
to "_the_new_page?param=foo" from the onclick command. How do I construct
that such that it forms that string and does a window.location with that
string? I looked over the web, but didn't find clear examples.
> I know this must be simple, but I need a little help as this isn't my
> area. I have a search box called searchText and a search button called
> searchButton. If a user puts "foo" in the text box and clicks the
> search button, I want this to change pages with "foo" as a parameter.
> Sort of go to "_the_new_page?param=foo" from the onclick command. How
> do I construct that such that it forms that string and does a
> window.location with that string? I looked over the web, but didn't
> find clear examples.
--
BootNic Friday November 30, 2007 12:32 AM
"So tell me, just how long have you had this feeling that no one is
watching you?"
*Christopher Locke: Entropy Gradient Reversals*
> "Shelly" wrote:
> news:13kv5o63hg13o18@corp.supernews.com:
>
>> I know this must be simple, but I need a little help as this isn't my
>> area. I have a search box called searchText and a search button called
>> searchButton. If a user puts "foo" in the text box and clicks the
>> search button, I want this to change pages with "foo" as a parameter.
>> Sort of go to "_the_new_page?param=foo" from the onclick command. How
>> do I construct that such that it forms that string and does a
>> window.location with that string? I looked over the web, but didn't
>> find clear examples.
>
>
Re: Search button
am 30.11.2007 12:38:50 von Shelly
BootNic wrote:
> BootNic wrote: news:Xns99F85784EC4CBootNic@
> 85.214.90.236:
>
>> "Shelly" wrote:
>> news:13kv5o63hg13o18@corp.supernews.com:
>>
>>> I know this must be simple, but I need a little help as this isn't
>>> my area. I have a search box called searchText and a search button
>>> called searchButton. If a user puts "foo" in the text box and
>>> clicks the search button, I want this to change pages with "foo" as
>>> a parameter. Sort of go to "_the_new_page?param=foo" from the
>>> onclick command. How do I construct that such that it forms that
>>> string and does a window.location with that string? I looked over
>>> the web, but didn't find clear examples.
>>
>>
Re: Search button
am 30.11.2007 13:38:07 von Toby A Inkster
Shelly wrote:
> Would I rather just need to define a hidden field and give it the name
> "type" and the value "blah" ?
Yep. That's certainly the easiest way.
> If this is the case, then I am left with the single problem of the not
> having an input button of type submit, but having an image instead.
If you give that input a name, then the browser should also add x,y co-
ordinates for the pixel that the user clicked on to the resultant URL.
Sometimes that's useful. Most of the time it's not.
--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.17.14-mm-desktop-9mdvsmp, up 5 days, 19:25.]
Sharing Music with Apple iTunes
http://tobyinkster.co.uk/blog/2007/11/28/itunes-sharing/
Re: Search button
am 30.11.2007 15:35:46 von jkorpela
Scripsit Toby A Inkster:
> Shelly wrote:
- -
>> If this is the case, then I am left with the single problem of the
>> not having an input button of type submit, but having an image
>> instead.
Huh? _What_ is the problem? If the problem is that you don't have a
normal submit button, get one. ;-) If not, make sure that you are
solving a problem and not creasting one.
>
Well, the alt text is too long. The button text should seldom be longer
than one or two words, like "Submit query". And you should also have the
name="Submit query" and value="Submit query", for user agents that use
_them_ and not the alt attribute as fallback.
> If you give that input a name, then the browser should also add x,y
> co- ordinates for the pixel that the user clicked on to the resultant
> URL. Sometimes that's useful. Most of the time it's not.
The coordinates are not included unless there is a name="..." attribute.
But image submit buttons are almost always a bad idea. They are mostly
used for esthetic reasons, but I don't think I've _ever_ seen such a
button that looks better than, say, the default rendering of submit
buttons on XP or Vista. I might say that _some_ of them were a slight
improvement over the "ugly gray buttons" in stone-age browsers that are
mostly used by freaks these days.
--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/
Re: Search button
am 30.11.2007 15:36:08 von Shelly
Toby A Inkster wrote:
> Shelly wrote:
>
>> Would I rather just need to define a hidden field and give it the
>> name "type" and the value "blah" ?
>
> Yep. That's certainly the easiest way.
>
>> If this is the case, then I am left with the single problem of the
>> not having an input button of type submit, but having an image
>> instead.
>
>
>
> If you give that input a name, then the browser should also add x,y
> co- ordinates for the pixel that the user clicked on to the resultant
> URL. Sometimes that's useful. Most of the time it's not.
Thank you very much. That worked like a charm. The hidden fields were
necessary.
--
Shelly
Re: Search button
am 30.11.2007 17:50:56 von Toby A Inkster
Jukka K. Korpela wrote:
> Scripsit Toby A Inkster:
>
>> If you give that input a name, then the browser should also add x,y co-
>> ordinates for the pixel that the user clicked on to the resultant URL.
>
> The coordinates are not included unless there is a name="..." attribute.
Isn't that what I said?
--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.17.14-mm-desktop-9mdvsmp, up 5 days, 23:40.]
Sharing Music with Apple iTunes
http://tobyinkster.co.uk/blog/2007/11/28/itunes-sharing/