Hi Roger.
Yes you can use the same name in diffrent pages(it's not recomended but permited).
In this case you should modify given code with following one:
precode
function GetApperyInputValue(inputName, pageName){
var input;
if(pageName)
input = jQuery('#' + pageName + ' [name="' + inputName + '"]')[0]
else
input = Appery(inputName)[0];
Code: Select all
if(!input)
return ""
input.focus();
document.execCommand("SelectAll");
var displayValue = window.getSelection().toString();
document.execCommand("Unselect");
input.blur();
return displayValue;
};
/code/pre
And invoke this function with following way:
precode
//Get value of input with name "aaa" if there is only one input with this name.
GetApperyInputValue("aaa")
//Get value of input with name "aaa" on known page. There could be several inputs with this name on several pages.
//Note you need to pass screen name like "Screen4".
GetApperyInputValue("aaa", "Screen4")
/code/pre
Regards.