Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

is this valid 2

Status
Not open for further replies.

simon551

IS-IT--Management
May 4, 2005
249
Hi, I'm trying to modify some javascript that I downloaded from formassembly.com and I just want to figure out what I'm doing wrong; whether I have the right syntax, before I go bugging the creators about their part of the code (not shown). Thanks in advance!

This is my code:
Code:
     var field1 = document.getElementById('hours');
      var field2  = document.getElementById('minutes');
              
      if(field1.value == ""){
		if(field2.value == "") 
       {
        // do something  
       }
}
 
assuming there are elements with ids = hours and minutes, yes it is valid code, no syntax errors.

[monkey][snake] <.
 
Also assuming there are only one of each element with the id of "hours" and "minutes", and that they have a "value" attribute (presumably they are text input boxes?).

Dan


Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top