html program

html program

Create a set of checkboxes with the below text: Which company do you work in? Infosys TCS Wipro Microsoft Google None of these If â??None of theseâ?? is selected with any other, show a error message â??Invalid selectionâ??.

View Answers

February 25, 2011 at 1:35 PM

JavaScript Check box Validation

<html>
<script>
Array.prototype.contains = function (element) {
for (var i = 0; i < this.length; i++) {
if (this[i] == element) {
return true;
}
}
return false;
}
function validate(){
var array = new Array();
var total=""
for(var i=0; i < document.f.company.length; i++){
if(document.f.company[i].checked)
array[i]=document.f.company[i].value;
}
if(array.contains("None of these")&&array.length>1){
alert("Invalid Selection");
}
return false;
}
</script>
<form name="f">
Which company do you work in?<br>
<input type="checkbox" name="company" value="Infosys">Infosys<br>
<input type="checkbox" name="company" value="TCS">TCS<br>
<input type="checkbox" name="company" value="Wipro">Wipro<br>
<input type="checkbox" name="company" value="Microsoft">Microsoft<br>
<input type="checkbox" name="company" value="Google">Google<br>
<input type="checkbox" name="company" value="None of these">None of these<br>
<input type="button" value="Check" onclick="validate();">
</form>









Related Tutorials/Questions & Answers:
html program
html program  Create a set of checkboxes with the below text: Which company do you work in? Infosys TCS Wipro Microsoft Google None of these If â??None of theseâ?? is selected with any other, show a error message â?
html program to create home page
html program to create home page  html program to create home page
Advertisements
write a program for creating html page with images and 2 buttons
write a program for creating html page with images and 2 buttons  write a program for creating html page with images and 2 buttons
html
html  sir i am new to eclipse and i am created a html program and also tomcat is running successfully in side the eclipse.but now how i deploy that html program in the eclipse
html
html   write a html program to print "HELLO WORD"in red coaler font size 12 and italic stile   Here is a html code that display the message "Hello World" in red font with size 12 and in italics. <html> <
HTML
HTML  What is Semantic HTML? What are the reasons for validating a HTML
HTML
HTML  What is Semantic HTML? What are the reasons for validating a HTML
HTML
HTML  What is SPAN in HTML
HTML
HTML  What is BODY in HTML document
html
html  diffrence between html and xml
html
html  How to add the calendar in html code
HTML
HTML  What is HTML? What is a Hypertext link
HTML
HTML  What is HTML? What is a Hypertext link
Html
Html  What is HTML? What is a Hypertext link
html
add a header in the html page  what we can do to add a header in the html page
program
program  write a html program in show table and this word in box
HTML
HTML  How do we specify page breaks in HTML
html
html  how to convert html page into jsp page
html
html  i want a registration page in html with good background
html
html  what we can do to add a header in the html page
html
html  what we can do to add a header in the html page
HTML
HTML  What is a tag? How can we use MARQUEE in HTML
HTML
HTML  how can we give the unlimited size in the html
HTML
HTML  Hi, What is the full form of HTML? Thanks (adsbygoogle = window.adsbygoogle || []).push({});   Hi, The HTML stands for HyperText Markup Language. HTML is used to create webpage for world wide web
HTML
HTML  How do we create a link? What are the three types of form tags in HTML
html
html  how we can give the form actions in html after register button in the login page
html
Adding Header in HTML  what we can do to add a header in the html page
html
html  Can we Access database through html page and how,if not then why
html
html  For what is used HTML?   Using HTML we can create a Web Page which can be viewed through a Web Browser over Internet. HTML describes... or the End Tag is defined as </> . The whole HTML document is enclosed
How to pass and catch HTML parameters to a Java program using REST services?(without using servlet/jsp)
How to pass and catch HTML parameters to a Java program using REST services... and catch HTML parameters to a Java program using REST services?(without using... username and password from HTML file, passes these parameters to a JAVA file through
Html
Html  in the web page if judge select the age and category then automatically under that conditions the details will be display in the form of grid give me that code in html and java
Html
Html  i am select the dateofbirth through the html browser.but it can not save into the sql server 2008 database.any special code required to store the date in database by using java servlets
HTML
HTML  I have created an info.html file for the applet.The class file is located in a directory different from the HTML file.The info.html file I have created is below. <HTML> <HEAD> <BODY> <APPLET Code
HTML
HTML  in html how can we can upload the file <tr> <td><strong>Video of the work:</strong> <td><b>... the file give me the code for this in html and java
HTML
HTML  how can we design the gird form view in html i want the following fields in the grid form The fields are Name of the candidate,Title... me the coding for this in html
Simple program to combine all html,ajax,java,servlets,jsp,json - Java Beginners
Simple program to combine all html,ajax,java,servlets,jsp,json  Hi, I learned Java,servlets,jsp basics, html, ajax, json and css. I want to do a program which is a combination of all those technology. For that, i planned
html
html  Create a web page with the following using HTML i) To embed an image map in a web page ii) To fix the hot spots iii) Show all the related information when the hot spots are clicked.please reply me sir
Html
Html  I was designing a webpage, i need to create selection boxes one beside other, how i'll be able to do it using HTML code, Please give me a sample code for that... looking forward for your usefull code
Html
:48:44 PM Author : SAMSUNG --%> <%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01...; <head> <meta http-equiv="Content-Type" content="text/html
Html
:48:44 PM Author : SAMSUNG --%> <%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01...; <head> <meta http-equiv="Content-Type" content="text/html
HTML
where i can store in the database SEND ME THE CODE FOR THIS IN JAVA AND HTML
Html
Html  in html form for the address by using input as textarea i am writing the code as <tr> <td valign="top"><strong>Address: </strong></td> <td><textarea name="Address" rows="8
html
html   HTML document with Javascript to count the number of vowels in a text typed in text area. please send the code.   Hi Ravi Here... HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD>
Html
Html  can we send data from one html page to another html page? if yes how?   Yes, using javascript. 1)page1.html: <html> <form type=get action="page2.html"> <table> <tr> <td>First Name
HTML
it shows as null. here is the html code for date of birth: <tr> <
HTML
HTML       HTML is used for creating the web pages on Internet. HTML.... If you have to create a website you have to use the HTML for creating pages
program
program  any program of hotel or school management
program
program  program of jdbc using ms access for creating table
program
program  write a javascript program to create a application form with validation
program
program  write a program different between to dates in terms of days in java

Ads