views:

460

answers:

1

So I've got a form with a submit button and a text input...

I want: http://localhost/

to become: http://localhost/#q=

I did a solution in javascript which involves changing the "action" of the form to the url with the hash onclick.. but this doesn't work in IE.

Anyone have a solution that works on all browsers?

+4  A: 
<script>
function add_hash() {
    window.location.hash = "q=";
}    
</script>

<form onsubmit="add_hash(); return false;">

Not sure what you're doing with this, though.

Luca Matteis
Most likely some kind of search or lookup system, something like google does.
Zachery Delafosse