html program

Ads

 
 

Share on Google+Share on Google+

vinay kumar reddy
html program
1 Answer(s)      6 years and 7 months ago
Posted in : HTML

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â??.

Ads
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>

Ads









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
program
program  write a html program in show table and this word in box
HTML
HTML  What is HTML? What is a Hypertext link
Html
Html  What is HTML? What is a Hypertext link
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
add a header in the html page  what we can do to add a header in the html page
HTML
HTML  How do we specify page breaks in HTML
HTML
HTML  What is a tag? How can we use MARQUEE 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  how can we give the unlimited size in the html
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  Hi, What is the full form of HTML? Thanks   Hi, The HTML stands for HyperText Markup Language. HTML is used to create webpage for world wide web. Web pages are accessed by web browsers and then shown
html
html  Can we Access database through html page and how,if not then why
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  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

Ads

 
Advertisement null

Ads