Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
FormAPI
System
Hi,
I want to do DCRName Validation after the user enter the name of DCR.
When i use below function it is directly going for the validation without asking the DCR Name.Could pls. suggest me which is right way to do this
I am using the following function
IWEventRegistry.addFormHandler("onSaveValid", onSave);
function onSave()
{
var dcrName = IWDCRInfo.getDCRName();
var sname = dcrName.substr(0,1);
if (sname.match(/^[A-Za-z]$/))
{
IWDCRInfo.setDCRName(dcrName);
return true;
}
else
{
alert(" DCR NAME SHOULD START WITH ALPHABETICS ");
return false;
}
}
Thanx in advance
Find more posts tagged with
Comments
Migrateduser
Don't you want onSaveNameSpecified? And since at that point the DCR name has already been set, you don't have to set it. Also, couldn't your DCR be in a folder (so the DCR name would start with / maybe instead of a letter)?
Edited by john on 05/15/03 07:32 AM (server time).
Migrateduser
Thanx for your reply
IWEventRegistry.addHandler("onSaveNameSpecified", onName);
I used the above function. It is asking for DCR Name but it is not executing the onName() for validation.
Now i have DCR Name Validation in onName() function
Thanx
Vicki
Hi. Try replacing addHandler with addFormHandler. I think this is a typo from their doco which I have reported to Interwoven.
deepakb
Yes, the addFormHandler works should work for you.
This is what I had
function init() {
IWEventRegistry.addFormHandler("onSaveNameSpecified", validateDcrName);
}
Migrateduser
Thanx for all your replies it works with addFormHandler
Migrateduser
Hi,
I have the following code to validate the name.After the user enters the name in validateDCRName i am checkfing whether it is valid name or not then returning either true or false.
in the function validateDCRName getDCRName is returning always empty ?
Could any one tell me how to set the DCRName ?
function init() {
IWEventRegistry.addFormHandler("onSaveNameSpecified", validateDCRName);
}
function validateDCRName()
{
//validation
}
when i clicked the save button it is asking for DCR Name .After i entered the DCR Name it is validating but it is always empty.
If i used setDCRName() what all the arguments i have to pass?
Thanx in advance