Hi, can alertjs popup a dialog with input textbox?
*This post is locked for comments
Try removing the parentheses after getType.
Based on documentation this is the way to do it (after OK/type is clicked.
now it is working, I have to remove the whole bracket.
Hi, Aric,
It still doesn't work until I make the change like the below, but it is not call back anymore, it directly execute the function "getType"
function addAmount(){ debugger; Alert.showWebResource("/Html/AddAmount",300, 200,"Please add amount for refund or decline", [ new Alert.Button("type",getType()), new Alert.Button("Not now") ]); }
Remove the function part from your getType call, or put the function inside:
function addAmount(){
debugger;
Alert.showWebResource("/Html/AddAmount",300, 200,"Please add amount for refund or decline",
[
new Alert.Button("type",getType(),true, true,),
new Alert.Button("Not now")
]);
}
Check if that fixes the issue.
When you put a function ahead of the function name, the actual code has to go in there. If you want to call a function, you do not put the keyword function and curly braces.
Hope this helps.
it looks like it complains the button call back function "getType", once I remove that it works, but I do need the call back function.
What error are you getting?
Hi, I am trying to get the values from the webresource, but I keep getting error, not sure what else I have missed.
function addAmount(){ debugger; Alert.showWebResource("/Html/AddAmount",300, 200,"Please add amount for refund or decline", [ new Alert.Button("type",function (){getType()},true, true,), new Alert.Button("Not now") ]); } function getType(){ debugger; var iFrameWindow = Alert.getIFrameWindow(); var amount = iFrameWindow.document.getElementById("amount").value; var webtype = iFrameWindow.document.getElementById("type"); alert(webtype.options[webtype.selectedIndex].text,amount); }
Hi,
I don't think it can display a textbox, but it can display an iframe (maybe a web resource with a textbox then?)
https://github.com/PaulNieuwelaar/alertjs/wiki/Documentation#alertshowiframe
There is, also, an example of how to read return value from an input textbox in such an iframe
Yes,
You can do it by using the Alert.showWebResource.
Create your own web resource with your own requirements, and call the above function.
See: github.com/.../Documentation
Hope this helps...
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,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156