PDA

View Full Version : Using the percentage sign in a web app



hmischel@diligentsystems.com
2015-03-20, 15:27
There are times when you may need to use a percentage sign in your app.

In my case, I am filtering a grid using the like statement against SQL Server.

since the % sign is a mod function in javascript, you need to escape it out using %25.

So in my case, I concatenate the value to my textbox value.


function page1_section1_field2_click()
{
var m_filter1 = txtfilter.value;
var m_filter = '%25'+m_filter1+'%25';

Lianja.get("page1.Al_SQLServers").filter ="computername like '"+m_filter+"'";
Lianja.get("page1.Al_SQLServers").refresh();

};


Just something someone else might find useful one day.

Herb