var $j = jQuery.noConflict();
var size= $j("#company_size :selected").text();
It's kind of hack-ish, but you could use AJaX to send that value to a php page that inserts the value into the session scope, making it available globally.
The answer depends on what you are doing exactly. If the user selects an option and the results are shown on a new page, the data would be submitted in a form. The form can be submitted by query using the 'change' event.
<form action='#' method='get' />
<select name='company size'>
If the data is shown on the same page, the process is basically the same, except you would use Ajax to submit and retrieve the form data.
You would then use wp_query to search for posts that match the variable.
A global variable would be hackish and isn't needed. There are a couple of methods that I outlined above for sending the variable directly to a php processor.
suppose your jquery variable is var j.okay.
create a input type and asign id xyz.
now write document.getelelementbyid('xyz').value= var j
thn your value will be asigned to inputtype.
hope this helps.
Thanks everyone, I'll give this a try. Cheers
This topic is now closed. New replies are no longer allowed.