Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / HTML, CSS, Scripts / JavaScript / October 2006



Tip: Looking for answers? Try searching our database.

Validation

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jason.tadeo@gmail.com - 31 Oct 2006 02:03 GMT
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();

   }



}                                              

thanks
jason
RobG - 31 Oct 2006 04:12 GMT
> 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.

Your strategy is good, the execution sux! :-)

Have a read of group FAQ, in particular the sections on

How do I get the value of a form control?
 <URL: http://www.jibbering.com/faq/#FAQ4_13

How do I modify the current page in a browser?
 <URL: http://www.jibbering.com/faq/#FAQ4_15 >

There is a reasonable javascript tutorial at w3schools, be aware that
some of their stuff is old, IE-centric definitely not de rigour, but OK
for an intro.

Signature

Rob

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.