Click here to Skip to main content
15,883,831 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a web page that uses the get command to retrieve a user entered string. This string is then passed via a proprietary language into a sql search. I want to convert any &nbs to to % so that user entered spaces become wildcards instead of spaces. Is there a script or series of commands that can be built into the get call?

Here is the code:

HTML
<td class="EntVal">
            <form action="http:/scripts/trs.exe" method="get">
              <input onblur="EntBlur(this)" onfocus="EntFocus(this)" onkeydown="EntKeyDown(this)" class="CODE" name="LIKE" /><input class="submit" type="submit" value="GO" name="BtnGo" /><input class="Hide" type="hidden" value="@CNC" name="CN" /><input class="Hide" type="hidden" value="@TER" name="TN" /><input class="Hide" type="hidden" value="pda" name="DN" /><input class="Hide" type="hidden" value="pda_pos_itm_search" name="CGI" /><input class="Hide" type="hidden" value="Pos" name="HOSTFORM" /><input class="Hide" type="hidden" value="0:0" name="CP" />
            </form>
          </td>


example:

user input = 'roc hot' get passes 'roc%hot%'

Thank you!
Posted
Updated 28-Jul-15 12:42pm
v5
Comments
Suvendu Shekhar Giri 28-Jul-15 17:01pm    
Can you share the relevant code ?
Member 11869787 28-Jul-15 17:53pm    
Posted, thank you.
Mohibur Rashid 28-Jul-15 21:38pm    
What would happen if user insert "100%"?
Member 11869787 29-Jul-15 7:52am    
The data is all sql compliant, so there is no need for other than alphanumeric user input.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900