Question
Text box not empty conditional statement
I've been asked to develop a survey and, in several places, a
score is given for the completion of text box. However, if there is
no text in the box, then a score of zero should be given.
I thought the best way to do this would be to use a hidden field with a conditional statement saying "if text box is not empty then score=4, else score=0.
However, firstly I'm not sure how to write this and secondly, how do you check if a text box is empty?
I think it really calls for some human input but the client is quite sure this is how he wants it.
The scores are all going to be inserted into a mysql database and sorted out there, so there may be some fudge available there but if php could do something nice in the code, that would be preferable.
Thanks in advance.
Andrew
I thought the best way to do this would be to use a hidden field with a conditional statement saying "if text box is not empty then score=4, else score=0.
However, firstly I'm not sure how to write this and secondly, how do you check if a text box is empty?
I think it really calls for some human input but the client is quite sure this is how he wants it.
The scores are all going to be inserted into a mysql database and sorted out there, so there may be some fudge available there but if php could do something nice in the code, that would be preferable.
Thanks in advance.
Andrew
