Client side validation

I want to retrieve values of fields for hand coded validation that I want to occur on the “Save Link” button for my application.

  1. Is this possible?

  2. How would I retrieve the value of a field name “link_text”?

Any references would be helpful. Also, I have tried using the xpages built in validation however there seems to be a few major issues with using the built in. At this point I would just like to write my own.

Subject: Re: Client-side validation

There are some useful posts on the web about working out the ID of the field, but you can pass it from client-side script to a script library using “#{id:…}” within the relvant Custom Control.

These links may help:

http://www.11tmr.com/11tmr.nsf/D6Plinks/MWHE-7K9BC3

http://www.11tmr.com/11tmr.nsf/archive?openview&type=Category&key=XPages

getClientId() works well to allow you to get the full path for the ID when referencing elements from client-side javascript. Thanks to Matt White’s posts, I created an elementPath computed field, with the value of:

return @LeftBack(getClientId(“elementPath”), “elementPath”)

I then pass that to the javascript library, to help compose the full path. Put the computed field on the relevant custom control, view the source, compare it to the IDs of other elements on the same custom control, and you’ll see how to use it.

Regards

Paul Withers