Skip navigation.

Digesting the internet

I imagine stuff as I blog photos and jokes I've made in various places.

To submit a form or not to submit a form?

Making the searchbox for the toolbar I found some anoying problems with styling buttons, submiting to multiple locations and opening links with javascript.

I thought the below was an interesting way to submit a form. One can use ordinary links for "submit" use 100 submit buttons and use a normal link to submit.

function zap(zz){
var thestring = document.getElementById('q').value
if (thestring != ""){
if (zz=="google")
{
document.getElementById(zz).href = "http://www.google.com/search\?client=opera&rls=en&q="+thestring+"&sourceid=opera&ie=utf-8&oe=utf-8"
}
else if (zz=="images")
{
document.getElementById(zz).href = "http://images.google.com/images\?client=opera&rls=en&q="+thestring+"&sourceid=opera&oe=UTF-8&ie=UTF-8&sa=N&tab=wi"
}
else if (zz=="gmail")
{
document.getElementById(zz).href = "http://gmail.google.com/gmail\?search=query&view=tl&start=0&init=1&fs=1&q="+thestring
}
}
}

the form would look something like this:

<form action="http://google.com/search" method="GET">
<input type="text" id="q" name="q" size="5" maxlength="255" value="" />
</form>

and the submit linkS looks like this:

<a id="google" onmousedown="zap('google');" href="http://google.com/">
<img src="images/favicon.gif" alt="Google">
</a>

If the text box is empty the normal link wil be opend, and if enter is pressed the search will be submitted.

Now I want to expand it a bit.

Opera Google toolbar codethe weegschaal

How to use Quote function:

  1. Select some text
  2. Click on the Quote link

Write a comment

Comment
(BBcode and HTML is turned off for anonymous user comments.)

If you can't read the words, press the small reload icon.


Smilies

January 2010
S M T W T F S
December 2009February 2010
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30