Use onClick in g_form.addInfoMessage
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2016 06:21 AM
1) g_form.addInfoMessage("<input type=button onClick=alert('from button') value='click here'>");
2) g_form.addInfoMessage("<input type=button onClick=return myFunction(); value='click here'>");
function myFunction()
{
alert('in function');
}
onclick function is not working!
Please help!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2016 07:57 AM
Why are you using info messages for creating buttons. Why not UI actions?
Anyways:
Try
g_form.addInfoMessage("<input type=button onClick=javascript:alert('from_button'); value='click here'>");

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2016 08:06 AM
Hi Sajan,
I can't remember whether field messages actually support this and I agree that it shuold be in a ui action. What is the purpose of the click alert?
I would try the following syntax though where you're escaping quotes and onclick is all lowercase:
g_form.addInfoMessage('<input type="button" onclick="alert(\'from button\')" value="click here">');