html - Submitting a form value straight into the URL? -



html - Submitting a form value straight into the URL? -

i've created paginator search function on site. paginator works fine, search function. however, issue have i'm having utilize excess code pass through value of form run query with. ideally, want when press submit button + page submits, posts value form straight url url variable, submitting it, checking see if form in question defined, storing value variable, passing variable through url's of page links stores url variable. want cutting out middle man , create url variable word go. suggestions? guys.

<cfif isdefined("form.search")> <cfset search = form.search> </cfif> <cfquery datasource="test.datasource" name="findbands"> select test_band test test_band <cfqueryparam value="%#search#%" cfsqltype="cf_sql_varchar" /> </cfquery> <form action="band_search.cfm" method="post"> <input type="text" name="search"></input> <input type="submit" value="go"></input> </form> <cfoutput query="findbands" startrow="1" maxrows="10"> #currentrow#) #test_band# </cfoutput> <cfif isdefined("search")> <cfset link = cgi.script_name & "?search=" & search> <a href="#link#>previous</a> </cfif> <cfif isdefined("search")> <cfset link = cgi.script_name & "?search=" & search> <a href="#link#>next</a> </cfif>

i haven't demonstrated above, have got code passes url variable editing start row , calculating total amount of pages. irrelevant. solution need when submitting form can utilize url.search rather having create variable search shown. thanks.

use method of "get" rather "post". attach inputs action string url parameters.

change line:

<form action="band_search.cfm" method="post">

to:

<form action="band_search.cfm" method="get">

html url variables coldfusion

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -