Hi,
Given below my code.
function example (){
alert('1');
var rgCell = /[0-9]{3}-[0-9]{3}-[0-9]{4}/;
alert('2');
var mobile =Xrm.Page.getAttribute(“new_mobilenum”).getValue( );
alert('3');
}
Hear alert working 1 and 2 but 3 is error. given below paste my error
One of the scripts for this record has caused an error. For more details, download the log file.
ReferenceError: 'example' is undefined at eval code (eval code:1:1)
Regards,
Naresh.
*This post is locked for comments
Thanks Naresh.
Please mark the answer as verified and use new thread for any of your new questions.
Hi Ravi,
Thanks for yor help
Thanks,
Naresh.
Hi Naresh,
You can try this-
if (pancard == pancard.toUpperCase()) {
alert('true');
}
else {
alert('false');
}
Hi,
function checkPan( )
{
var pancard = Xrm.Page.getAttribute("new_pannum").getValue( );
if(pancard .length != 10 )
{
alert('PAN Number not valid. It must be of 10 Digits');
}
}
//Hear alert is working but i need when i enter like this "ctljy6626h" i need showing to "please enter Capitals" how to write logic please help me.
Thanks,
Naresh.
Hi Naresh,
As told by Ravi, you have incorrect braces in the code. Modify the code as shown below.
function example1() { alert('1'); var Cell = /[0-9]{3}-[0-9]{3}-[0-9]{4}/; alert('2'); var mobile = Xrm.Page.getAttribute("new_mobilenum").getValue(); if (Cell.Test(mobile)) { alert('valid'); } else { // Invalid phone number alert('Please enter a valid phone number (ex. 123-123-1234).'); } }
Hope this helps.
You have missing ' }' after the line ' alert('valid');' and have an extra '}' in the end
Hi Ravi,
Given below mention code that showing error. please see the if any error.
function example1(){
alert('1');
var Cell = /[0-9]{3}-[0-9]{3}-[0-9]{4}/;
alert('2');
var mobile =Xrm.Page.getAttribute("new_mobilenum").getValue( );
if (Cell.Test (mobile ))
{
alert('valid');
else {
// Invalid phone number
alert ('Please enter a valid phone number (ex. 123-123-1234).');
}
}
}
Hi Alex,
it is working thanks for your help.
Thanks,
Naresh.
Hi sandeep,
Thanks for your help.
Thanks,
Naresh.
please mark the suggested answers verified if you find it is helpful
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156