eckul — 2014-05-01T09:44:52-04:00 — #1
var $j = jQuery.noConflict();
var size= $j("#company_size :selected").text();
wolfshade — 2014-05-01T10:02:54-04:00 — #2
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.
eruna — 2014-05-01T10:06:35-04:00 — #3
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.
eruna — 2014-05-01T10:08:40-04:00 — #4
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.
xeliumtech — 2014-05-03T07:25:19-04:00 — #5
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.
eckul — 2014-05-05T19:45:21-04:00 — #6
Thanks everyone, I'll give this a try. Cheers