- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello experts,
When clicked on a catalog item url from esc portal, it is opening as a below link
Is there any way by which we can extract the short_descripton value from the URL itself highlighted in yellow via any catalog client script. plz help
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @Deepika54 ,
Here is a catalog client script that runs onLoad extracts the short_description value from the URL:
function onLoad() {
var short_description = getParmVal('short_description'); //URL parameter
if (short_description) {
g_form.setValue('variable_name', short_description); //Set Variable
}
}
function getParmVal(name) {
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
var regexS = "[\\?&]" + name + "=([^&#]*)";
var regex = new RegExp(regexS);
var results = regex.exec(top.location);
if (results == null) {
return "";
} else {
return unescape(results[1]);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @Deepika54 ,
Here is a catalog client script that runs onLoad extracts the short_description value from the URL:
function onLoad() {
var short_description = getParmVal('short_description'); //URL parameter
if (short_description) {
g_form.setValue('variable_name', short_description); //Set Variable
}
}
function getParmVal(name) {
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
var regexS = "[\\?&]" + name + "=([^&#]*)";
var regex = new RegExp(regexS);
var results = regex.exec(top.location);
if (results == null) {
return "";
} else {
return unescape(results[1]);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
you are the best