Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Form-API
System
Hi,
I have a problem with setDCRName function.
I am using the following handler
IWEventRegistry.addFormHandler("onSaveNameSpecified", handle_saveNameSpecified);
Once i entered the dcr name it shd. validate the name then setDCR name. It is working without set dcr name.But in my case aftervalidation i want to append workarea name to the dcrname then i want to setDCRName.
for ex:
If i entered test as dcr name it shd. set it as WORKAREANAME_test.
Here i am giving my function.
function handle_saveNameSpecified(path)
{
valid = true;
sname = path.substr(path.lastIndexOf("/data")+6,1);
cond = true;
cond = sname.match(/^[A-Za-z]$/)
if(!cond)
{
alert("DCR NAME SHOULD START WITH ALPHABETICS.Press Save again ");
return(false);
}
if ( path.lastIndexOf( "." ) > -1 )
{
ext = path.substring( path.lastIndexOf( "." ) + 1, path.length );
if ( ext == "asp" || ext == "aspx" || ext == "htm" || ext == "html" || ext == "jsp" || ext == "dcr" )
{
alert( "Do not specify an extension for the file. Press Save again." );
return( false );
}
}
if ( valid )
{
regex = new RegExp( "^(.*)([&% ])(.+)$" );
list = regex.exec( path );
if ( list != null && list != undefined )
{
valid = confirm( "The specified file name contains characters (spaces, &, %, etc.) that are not suggested for web file names. Press Cancel and save again to change the file name, or press OK to ignore this warning." );
}
}
if (valid)
{
dcr = path.substring( path.lastIndexOf( "/" ) + 1,path.length );
var area = parent.gWorkarea;
area = area+'';
area = area.substring(area.lastIndexOf( "/" ) + 1,area.length );
path = path.substring(0, path.lastIndexOf( "/" ) + 1);
name = area+'_'+dcr;
path = path+name;
IWDCRInfo.setDCRName(path);
}
In the above function.It is working with out
if (valid)
{
} block.
Thanx in advance
Find more posts tagged with
Comments
Migrateduser
Before setDCRName it is showing path name but it is taking the DCRName what we entered in window .It is not taking what ever we are appending to the dcrname.
Thanx in advance