A web link that is added to a form by a WQO agent is not functioning and it is not apparent why. Here’s some background:
Depending upon a user’s authorities, a link is added to a RichText field on a form by a WQO agent with the following code. (Additional HTML tags such as
appear above and below the RichText field on the form.)
A link created by the above code functions fine. However, if this code is modified to simply include an ‘onClick’ as follows, the link no longer functions.
The ‘onClick’ calls a JSHeader function called ‘validateField’ which properly displays a message if a field is null. However, if the field is not null, the link no longer functions. (The page does not change). If the mouse pointer is passed over the link, a valid URL appears on the gray bar at the bottom of the browser. Here is the JSHeader function:
function validateField( frm ) {
if (frm.FieldName.value ==null )
{alert('Please enter a valid value.');
}
}
I’d appreciate any ideas why the ‘onClick’ code that was added to the link prevents the link from functioning properly.
This may just be a typo in your post, but if it’s like this in your code, could cause the function to not work (and if you look at the JS console in Firefox/Netscape/Mozilla would throw an error):
By the way, I followed your suggestion from a previous post about installing Mozilla Firefox. You’re right - it does provide good debugging capabilities.
Peter, it seems that what you’re suggesting would always display a message when the link is clicked. The intent is to only display a message if a field validation fails which is determined in the JSHeader function. The problem I’ve encountered is that by adding the ‘onClick’ to the link (which calls the JSHeader function) the link has stopped functioning. Accordingly, if there is no field validation error, the link does not open another page as it should. It’s not apparent why adding the ‘onClick’ to the link made it no longer functional.
In short - pay attention to how quotes are handled when building strings. My preference is to always use Pipes for strings, as they seem easier for me to count when I must double them to embed in a string.
Now, when you launch this over the web, the CFD triggers like a WQO agent. The reason I suggest this is 1) obviously less overhead as it doesn’t need to call and return the agent to get the content into the RTF, and 2) you can simplify your link by simply building out the RTF contents in Formula language.
Good suggestion Chris, but it probably isn’t suited for this application. For one thing, the link needs to be displayed in any one of various languages. The application accesses a host DB2 database for the correct link name (depending upon the language specified on a user profile) as well as user authorities. The application is primarily a front end for moving data to and from DB2 - it is not a repository for Notes documents. A certain amount of logic needs to execute in accessing DB2, doing lookups, etc., and this seems to be beyond the scope of a formula in a CFD field.