TetLuppyted
New Member
http://jsfiddle.net/3vHxF/ Here is what I triedAnd my html code is :\[code\] <form id="commentForm" style="width:200px;" name="MYFORM" action="#"> <label> <strong>Enquiry Form </strong> </label> <label>Name</label> <input id="name" type="text" size="30" name="name"> <label>Phone No</label> <input id="phone" type="text" size="30" name="phone"> <label>Email</label> <input id="email" type="text"size="30" name="email"> <label>Message</label><br> <textarea id="message" name="message"></textarea> <input id="Send" type="submit" value="http://stackoverflow.com/questions/15524715/Send" onclick="send()"> </form>Javascript is :var name=getElementById('name');var phone=getElementById('phone');var email=getElementById('email');var mess=getElementById('message');function send(){if(name==null&&phone==null&&email==null&&mess==null) alert('field is empty');}\[/code\]I want to alert the field which is empty, and at the same time I want to write it simply. Please don't suggest any plug-ins.