testing for empty string w/ javascript
734426Dec 28 2010 — edited Dec 29 2010hi -- Quick question.
I have a javascript region that needs to disable some page items if they're not null. (Can't use the read-only condition in this case.)
What I've tried is this:
if (valueOf(&P202_KEY_NAME1.)!==='') {
document.getElementById("P202_KEY_NAME1").disabled = true;
}
(Those are 2 single quotes at the end.)
This comparison fails w/ an error when there's a value in P202_KEY_NAME1.
I've also tried just if (valueOf(&P202_KEY_NAME1.)) ... But it seems to always
test true... even when the item is empty.
What type of item reference and comparison do I need here? They're text items.
Thanks,
Carol