axa905
asked on
Remove first 3 characters
I'm not very good at Javascript, I'm using Dreamweamer's built in form validation and the problem is the error message is using the input field name instead of value, so for example it's using "txtName" instead of just "Name".
"nm" here is representing my input field name. All my field names have an extra 3 characters (like 'txt') at the begining. Can I somehow add something to this line of code and have those preceding first 3 letters removed from nm in the below line of code?
errors+='- '+nm+' must contain an e-mail address.\n';
Thank you so much.
"nm" here is representing my input field name. All my field names have an extra 3 characters (like 'txt') at the begining. Can I somehow add something to this line of code and have those preceding first 3 letters removed from nm in the below line of code?
errors+='- '+nm+' must contain an e-mail address.\n';
Thank you so much.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Try this,
errors+='- '+ nm.substring(3,nm.length-3
Hope this helps,
Neal.