You need to sign in to do that
Don't have an account?
MMA_FORCE
Null Value for inputText box????
Hi:
I have an inputText Field in VF:
<td><apex:inputText value="{!teachername}"/></td>
Then in my Apex Code I have:
if(teachername!=null){
qryString = qryString + 'where ' + teacher + '=' + '\''+ teachername+'\'';
}
Now the issue is if I do not place anything in that textbox and click on another filter and then click go button...
It gives me an error on my where statement bring up the teacher where statement...
It is null, I left it blan/empty/nothing in there...
Should I place something else instead of a null???
Thanks
You can try: if(teachername!='')
in my apex code a lot of my if statements include both because i'm never exactly sure when a field is null or not. So mine look like if(* !=null && * != '')
All Answers
You can try: if(teachername!='')
in my apex code a lot of my if statements include both because i'm never exactly sure when a field is null or not. So mine look like if(* !=null && * != '')
yes check both the condition,
if( teachername != null && teachername != '')