You need to sign in to do that
Don't have an account?
RAJU_DEEP
onclick() not working properly
Hello,
I am in a problem which seems to be silly but any how i stucked to it. I have a javascript code
function saveRecord() { if (document.getElementById("{!$Component.pg.frm.in}").value > document.getElementById("{!$Component.pg.frm.out}").value) { alert('SignIn time should be less then SignOut time'); } else if (document.getElementById("!$Component.pg.frm.in").value != '') { alert("Record Saved Successfully..."); } else { alert("Enter the SignIn Time"); } }
In this function the two datetime inputFields values is been used for the validation purpose.
this function is called by the command button through onclick, when i click on the button asper the condition it displays the first alert but if the condition switches to the nested if-else it doesn't shows anything. I don't know where i am going wrong. Is there any way to solve this.
Thanks in advance.
Raju.
Hello,
Thanks for your reply but I got the solution with the empty string.
All Answers
In nested if-else, don't use empty string. You should use null instead. Modify the code and run again. It should work.
Hope this helps.
Hello,
Thanks for your reply but I got the solution with the empty string.