php - Append selected value in the middle of a URL -
Any idea how would I add the URL to the place where it says is VALUE? I'm not sure how this is even more possible:
& lt; Form method = "get" action = "& lt; php echo site_url () ;? & gt; / discover /? Search_query = & amp; orderby = empty & tax_category = VALUEHERE & amp; wpas = 1" & gt; & Lt; Fieldset & gt; & Lt; Select name = "" & gt; & Lt; Option value = "" & gt; All categories & lt; / Options & gt; & Lt; Option value = "college-student" & gt; College students & lt; / Options & gt; & Lt; / Select & gt; & Lt; Button type = "submit" & gt; Search & lt; / Button & gt; & Lt; / Fieldset & gt; & Lt; / Form & gt;
jQuery usage:
var url = $ ("Form") attr ("action"). // Get URL; Url = url.replace ("VALUEHERE", $ ("Choose Form"). Val ()); Warning (url); // Your final URL
Comments
Post a Comment