[jQuery] Re: jQuery and PHP form problem

2008-12-16 Thread Mike Alsup
I GOT IT.  How to explain what the problem was?!...I've done a bit of tweaking, but one thing is I was returning false from my form submit handler WHICH IS WHY I WASN'T HITTING MY PHP $_POST BRANCH. Whenever I would submit I was getting my default search page again. Made the search field

[jQuery] Re: jQuery and PHP form problem

2008-12-16 Thread Cam Spiers
Just as a side note.. if(isset($_POST['search_button'])){ echo $_POST['search_field']; } You should use an isset()

[jQuery] Re: jQuery and PHP form problem

2008-12-16 Thread Alexandre Plennevaux
especially with available tools like jsbin ! http://jsbin.com/ if the google group app would allow it, i would include an invitation to use it in my signature but that 's not possible or is it? On Tue, Dec 16, 2008 at 12:29 PM, Mike Alsup mal...@gmail.com wrote: I GOT IT. How to explain

[jQuery] Re: jQuery and PHP form problem

2008-12-15 Thread Mike Alsup
Basically, what I'm running into is my php branch is not executed while the form has an id (jQuery is taking precendence). If I remove the id, the php branch works, but then obviously the jQuery code doesn't run. Anyone have any ideas how I can get both to run? Can I put php code in jQuery

[jQuery] Re: jQuery and PHP form problem

2008-12-15 Thread Magnificent
I'm not sure I understand. If you're saying change my inputs to: input id=search name=search type=text input id=btnSearch name=btnSearch type=submit value=Go That has no effect, the jQuery form binding still trumps the php $POST branch. On Dec 15, 4:43 pm, Mike Alsup mal...@gmail.com wrote:

[jQuery] Re: jQuery and PHP form problem

2008-12-15 Thread Magnificent
I'm wondering if echo'ing the jQuery script inside my PHP code will work. If I do: if($_POST['search_button']){ echo script type='text/javascript' alert('inside post branch'); /script ; } That works fine, but if I copy/paste in my jQuery code I want

[jQuery] Re: jQuery and PHP form problem

2008-12-15 Thread brian
On Mon, Dec 15, 2008 at 7:43 PM, Mike Alsup mal...@gmail.com wrote: You should never have an element with an id value that does not match its name value. Get that straightened out and you'll be fine. That's not true at all. Do you have a reference for that? The id attr. is solely for the

[jQuery] Re: jQuery and PHP form problem

2008-12-15 Thread brian
On Mon, Dec 15, 2008 at 8:18 PM, Magnificent imightbewrongbutidontthin...@gmail.com wrote: I'm wondering if echo'ing the jQuery script inside my PHP code will work. If I do: if($_POST['search_button']){ echo script type='text/javascript' alert('inside post branch');

[jQuery] Re: jQuery and PHP form problem

2008-12-15 Thread Magnificent
Here's what I'm doing: On page load, I fetch/format some 3rd party data. It always initially fetches the same data (and it works fine), so think of the initial load like a default search results page. I also have a search form on the page so users can fetch other data, they just type in

[jQuery] Re: jQuery and PHP form problem

2008-12-15 Thread Mike Alsup
You should never have an element with an id value that does not match its name value.  Get that straightened out and you'll be fine. That's not true at all. Do you have a reference for that? The id attr. is solely for the DOM, while name is passed to the server. Yes, that's quite true.

[jQuery] Re: jQuery and PHP form problem

2008-12-15 Thread Magnificent
Yes, the id on the form element. If I remove that, then var_dump $_POST, I'm definitely getting my form info, for example here's a var_dump of my latest search: array(2) { [search_field]= string(7) leopard [search_button] = string(2) Go } But then I already knew that because without the id I

[jQuery] Re: jQuery and PHP form problem

2008-12-15 Thread Mike Alsup
Yes, the id on the form element. If I remove that, then var_dump $_POST, I'm definitely getting my form info, for example here's a var_dump of my latest search: array(2) { [search_field]=  string(7) leopard [search_button] =  string(2) Go } But then I already knew that because without

[jQuery] Re: jQuery and PHP form problem

2008-12-15 Thread brian
On Mon, Dec 15, 2008 at 9:59 PM, Mike Alsup mal...@gmail.com wrote: You should never have an element with an id value that does not match its name value. Get that straightened out and you'll be fine. That's not true at all. Do you have a reference for that? The id attr. is solely for

[jQuery] Re: jQuery and PHP form problem

2008-12-15 Thread Magnificent
I made a quick standalone page and it seems to work fine. Form submit throws an alert then PHP echo's whatever you enter in the field. It looks I have issues elsewhere in my code? Here's the standalone page code: !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http://

[jQuery] Re: jQuery and PHP form problem

2008-12-15 Thread brian
On Mon, Dec 15, 2008 at 10:10 PM, Magnificent imightbewrongbutidontthin...@gmail.com wrote: Yes, the id on the form element. If I remove that, then var_dump $_POST, I'm definitely getting my form info, for example here's a var_dump of my latest search: array(2) { [search_field]= string(7)

[jQuery] Re: jQuery and PHP form problem

2008-12-15 Thread brian
$('#form_search').bind('submit', function() { alert('form sumitted'); }); What does your actual function do? Does it send anything to your PHP script?

[jQuery] Re: jQuery and PHP form problem

2008-12-15 Thread Magnificent
No, it just sends a request/formats 3rd party info based on whatever the user searches for. On Dec 15, 7:33 pm, brian bally.z...@gmail.com wrote: $('#form_search').bind('submit', function() {         alert('form sumitted'); }); What does your actual function do? Does it send anything to

[jQuery] Re: jQuery and PHP form problem

2008-12-15 Thread Magnificent
I GOT IT. How to explain what the problem was?!...I've done a bit of tweaking, but one thing is I was returning false from my form submit handler WHICH IS WHY I WASN'T HITTING MY PHP $_POST BRANCH. Whenever I would submit I was getting my default search page again. Made the search field