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
Just as a side note..
if(isset($_POST['search_button'])){
echo $_POST['search_field'];
}
You should use an isset()
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
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
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:
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
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
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');
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
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.
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
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
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
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://
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)
$('#form_search').bind('submit', function() {
alert('form sumitted');
});
What does your actual function do? Does it send anything to your PHP script?
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
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
18 matches
Mail list logo