Changes

Jump to: navigation, search

Pandora - Sample - Company Name Duplicate Check

733 bytes added, 17:33, 29 January 2011
Created page with 'The following script can be used on the company page to ensure there are no other companies with the same name already present in the system. It also replaces any quotation mar…'
The following script can be used on the company page to ensure there are no other companies with the same name already present in the system.

It also replaces any quotation marks within the name with an apostrophe.

<pre>
function savefunc(frm){
ss_developer_key="123456-4BjBBeH3oYVbBYgNX/E=";
frm.cname.value=frm.cname.value.replace(/"/g,"'");
if("@name@"!=frm.cname.value){
var qryfields = "name";
var qryfilter = " name='"+frm.cname.value.replace(/'/g,"\\'")+"'";
var rs = company_find(false,'',qryfields,qryfilter,'name',0,200,'');
if(rs.recordcount>0){
alert("An organization with that name already exists. Please enter a unique name.");
return false;
}
}
return true;
}
</pre>

[[Category:Pandora]]
0
edits

Navigation menu