View Full Version : IIF and textboxes
12-13-2011, 08:33 PM
I need your help,
I can seem to get this to work.
I want to be able to use an IIF to check if a textbox empty ie.
IIF(textbox1 = "" || textbox = null, "it is empty","it is not empty")
This doesnt seem to be working.
- Clueless =?
12-13-2011, 10:12 PM
In fact, IIF doesn't even exist in VBScript.
IIF exists in Visual Basic and in VBA (Visual Basic for Applications) and in VB.NET. So far as I know, those are the only places you find it.
var answer = (form.textbox1.value == "" || form.textbox1.vakue == null ) ? "it is empty" : "it is not empty";
Maybe it is time to start here?? http://www.w3schools.com/js/
12-13-2011, 10:14 PM
By the by, if indeed you are talking about <input name="textbox1" />, then the .value of such a field is *NEVER* empty. Form fields that have a .value property *always* return a STRING for that .value. Yes, it can be an empty string ("") but it can't be null.
So it would be sufficient to code
var answer = ( myform.textbox1.value == "" ) ? "it is empty" : "it is not empty";
Powered by vBulletin® Version 4.2.2 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.