# HTML \<form\> and redirecting the result

**URL:** <https://rubytalk.org/t/html-form-and-redirecting-the-result/48664>\
**Category:** ruby-talk\
**Created:** [28 August 2008 02:52 UTC](https://rubytalk.org/t/html-form-and-redirecting-the-result/48664 "2008-08-28T02:52:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marc\_Heiler](https://avatars.discourse-cdn.com/v4/letter/m/e8c25b/32.png) [@Marc\_Heiler](https://rubytalk.org/u/Marc_Heiler)\
**Post date:** [28 August 2008 02:52 UTC](https://rubytalk.org/t/html-form-and-redirecting-the-result/48664/1 "2008-08-28T02:52:30Z")

</div>

Hi there,

since a long time I am using a very simple ruby script that translates  
input like

'goo' or 'g' or 'google' to the remote URL of google

via a big case menu.

It has maybe one thousand entries or more, keeping my local pages  
together to.

For example if i type  
'open ruby'  
it will open my local ruby page.  
'browse php'  
it will open my local php page (i decided that my local stuff has  
priority over remote php webpage)

Anyway, the point of my message here is that this works beautifully, and  
I thought that I would like to have a little html \<form\> element which  
redirects me to the page once i finished typing and pressed submit (or  
hit enter)

But how do I do this?

For example, if i type 'ruby' in the \<input\> field, i would like to be  
redirected to the ruby homepage or similar when i press enter.

Will I need javascript for this redirection? Or a .cgi page required?

Any hints appreciated. If possible I'd rather prefer pure ruby than  
anything with javascript. I dont like leaving ruby. But for this  
functionality it would be fine, because right now I always use a shell,  
and firefox does not seem to have a nice happy shell 😉

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

---

<div class="post-metadata">

**Author:** ![Lay\_Lee](https://avatars.discourse-cdn.com/v4/letter/l/97f17d/32.png) [@Lay\_Lee](https://rubytalk.org/u/Lay_Lee)\
**Post date:** [28 August 2008 03:23 UTC](https://rubytalk.org/t/html-form-and-redirecting-the-result/48664/2 "2008-08-28T03:23:25Z")

</div>

if i need to do this function, i'll use javascript.

> **···**
>
> On Thu, Aug 28, 2008 at 10:52 AM, Marc Heiler \<shevegen@linuxmail.org\>wrote:
> 
> > Hi there,
> > 
> > since a long time I am using a very simple ruby script that translates  
> > input like
> > 
> > 'goo' or 'g' or 'google' to the remote URL of google
> > 
> > via a big case menu.
> > 
> > It has maybe one thousand entries or more, keeping my local pages  
> > together to.
> > 
> > For example if i type  
> > 'open ruby'  
> > it will open my local ruby page.  
> > 'browse php'  
> > it will open my local php page (i decided that my local stuff has  
> > priority over remote php webpage)
> > 
> > Anyway, the point of my message here is that this works beautifully, and  
> > I thought that I would like to have a little html \<form\> element which  
> > redirects me to the page once i finished typing and pressed submit (or  
> > hit enter)
> > 
> > But how do I do this?
> > 
> > For example, if i type 'ruby' in the \<input\> field, i would like to be  
> > redirected to the ruby homepage or similar when i press enter.
> > 
> > Will I need javascript for this redirection? Or a .cgi page required?
> > 
> > Any hints appreciated. If possible I'd rather prefer pure ruby than  
> > anything with javascript. I dont like leaving ruby. But for this  
> > functionality it would be fine, because right now I always use a shell,  
> > and firefox does not seem to have a nice happy shell 😉  
> > --  
> > Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).
> 
> --  
> Regards
> 
> Lilei
