|
Hi, I am working on a one page website that has a search form. When someone submits their form I would like to use the onclick function to append the form values to the url that loads my content via Ajax. Something like this: onclick="$('#demoContainer-store').mb_changeContainerContent('container-search/form-value1/form-value2');" Ultimately, I need those values from the form to pull information out of my database via PHP. Is it possible to append the submitted form values to the url or somehow pass the form data to the new container with the onClick function? Thank you, Jeff |
|
I figured this one out. For those that may have a similar issue, here's what I did: I had two input boxes in my form with id=searchname and id=searchstate, respectively. Then I used this to append the values as $_GET variables:
Hi Jeff, this is a solution, anyway the mb_changeContainerContent accept two parameters, the first is the URL of the page to get via ajax, the second is the parameters you whant to pass: jQuery.fn.mb_changeContainerContent=function(url, data). You can than pass your data as second parameter of the funxtion. Bye, Matteo
(Oct 04 '11 at 13:31)
Matteo Bicocchi ♦♦
|
|
Thanks Matteo. I read all the documentation I could find about passing data into mb_changeContainerContent by using the (url,data) method. That would be my preferred way to do it but I could never figure out the correct syntax and couldn't get it to work that way. Great script!! Regards, Jeff |


