Thursday, November 26, 2009

Re: [jQuery] form always goes to index.php

you dont need to you a form.

set up the following html

<input type="text" class="name" />
<a href="#" class='submitform">Submit</a>

have the follwoing jQUery

$(function() {

var btn_submit = $(".submitform");
var txt_name = $(".name");

btn_submit.click(function(e) {
e.preventDefault();
top.location = index.php?name="+txt_name.val();
});

});


it kinda works just like a form :)

you can access the values via phph $_GET[] as well.

On Thu, Nov 26, 2009 at 3:35 PM, Henjo <henjohoeksma@gmail.com> wrote:
Hi,

a form that has an action to an index.php?id=value is submitted
through jquery with $('form').submit() .
Somehow it always goes to the plain index.php adding the values behind
it like: index.php?myFormValue=value .

I don't get any errors in the debug console (FF) or the Error Console.
How can I get this to work properly?

When I mod_rewrite in index.php?id=value to - for example - 'results/'
it does work.

Thanks in advance.

Henjo

No comments: