jt3kgt
10-30-2006, 07:08 PM
I am newer to the javascript scene and i have figured out how to check
if a input box is empty or not but i like display the error right next
to the text box. I am not sure but i think it can be done by making a
div tag right next to it being empty. Anyone have an examples of code
or anything i would greatly appreciate it. here is what i have so far
for code.
where i want it
<.div id="1"> </div>
javascript
function send_if_valid()
{
if ( document.forms.newuser.email_a.value == "")
{
var str = "bah";
var obj = document.getElementById("1");
obj.document.open();
obj.document.write(str);
obj.document.close();
}
}
>>> i got that code from a book i could be totally off.
thanks
jason
if a input box is empty or not but i like display the error right next
to the text box. I am not sure but i think it can be done by making a
div tag right next to it being empty. Anyone have an examples of code
or anything i would greatly appreciate it. here is what i have so far
for code.
where i want it
<.div id="1"> </div>
javascript
function send_if_valid()
{
if ( document.forms.newuser.email_a.value == "")
{
var str = "bah";
var obj = document.getElementById("1");
obj.document.open();
obj.document.write(str);
obj.document.close();
}
}
>>> i got that code from a book i could be totally off.
thanks
jason