Hi everybody,

I try to do dynamic cross validation on two fields.
I have a grid into a form. On each row, I have a select field (OK and KO) and a textarea commentary.
When the user select KO, commentary is enabled and his value is required.
When the user select OK, commentary is disabled and no value is required.


My JS code :

function setReadOnly(selectValue, id)
{

    var myId = [id + 'C'];

    if (selectValue=='KO') {
        myId.each(function(item) {
            var myId = $(item);
            if (myId != null) {
              myId.removeAttribute('readOnly');
              Tapestry.Validator.required(myId, 'Please explain');
            }
        });
    } else {
        myId.each(function(item) {
            var myId = $(item);
            if (myId != null) {
              myId.clear();
              myId.setAttribute('readOnly', 'true');
              myId.getFieldEventManager().removeDecorations();
              myId.getFieldEventManager().requiredCheck = null;


            }
        });

    }
}


It seems working but when I select KO, fill commentary, submit then select OK and submit, the submit is good but the ErrorPopup appears without message (only the red cross)

Two questions :
1. Did I miss something ?
2. Is there a better way to do it ?

Thanks in advance, Thomas

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to