- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-19-2016 05:08 PM
Hi Guys,
Does anybody know how to do formatting with a text variable in Service Catalog items? My requirement is as follows:
Users need to insert a particular format:
ABC-12DE34-567-FGHI
The first bit only letters, second bit letters and numbers, third bit only numbers etc. My goal to provide users a nice text box which looks like this and also perform validation at the same time
I read in the wiki that I can accomplish this using UI Macros but I couldn't find any useful example that I can use as a guide. Can someone give me some hints?
Regards,
Mussie
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-19-2016 10:27 PM
I was able to do this using regular expressions:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
//format should be ABC/12DE34/567/FGHI
var filter = ^([a-zA-Z]{3})\/(\w{6})\/(\d{3})\/([a-zA-Z]{4})$
if(!filter.test(newValue)){
alert("Invalid subject code format, it should be in this format - ABC-12DE34-567-FGHI.");
g_form.setValue('subject_code_string', '');
}
}
Mussie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-19-2016 10:27 PM
I was able to do this using regular expressions:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
//format should be ABC/12DE34/567/FGHI
var filter = ^([a-zA-Z]{3})\/(\w{6})\/(\d{3})\/([a-zA-Z]{4})$
if(!filter.test(newValue)){
alert("Invalid subject code format, it should be in this format - ABC-12DE34-567-FGHI.");
g_form.setValue('subject_code_string', '');
}
}
Mussie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-15-2016 06:35 AM
Hi,
I want name field value does not contains any blank spaces at beginning and ending
example:-
name: snow(beginning space)
name:snow (ending space)
Thanks,
rambabu