Question: popup window checkbox and sbumit button

Ads

 
 
 

Share on Google+Share on Google+

srini anumala
popup window checkbox and sbumit button
3 Answer(s)      5 years and 2 months ago
Posted in : JavaScript Questions

Hi,

Requirement: popup window having multiple checkboxes, I have to select couple of checkboxes and click the submit button.

I am unable to get the check box values... need help on this ....

my javascript code:

function openWin(form) {

var countryName = " ";


var countries = form.countries.value;
var myStringArray = new Array();
var stringCount = countries.split(",");  
for(var i=0;i<(stringCount.length)-1;i++){
    myStringArray.push(stringCount[i]);
}



    for (var i = 0; i < myStringArray.length; i++) {

            display=window.open('','NewWin','menubar=0,location=no,status=no,directories=no,toolbar=no,scrollbars=yes,height=500,width=500')
            message="<font face='verdana, arial, helvetica, san-serif' size='2'><form>";
            message+="<input type='checkbox' name='listCountry'  value='myStringArray'/>" +myStringArray[i]+ "<br />";
            message+="</form></font>";
            display.moveTo(30,20);
            display.document.write(message); 
            if(myStringArray[i].checked == true){
                countryName = countryName + myStringArray[i] + " ";
            }  
      }
    message="<input type='button' name='countryName' value='Submit' />"+"    "+" ";
    message+="<input type='button' name='Cancel' value='reset' />" ;
    display.document.write(message);    
    window.location.replace("ADTReports.jsp?countryName="+countryName);

}

Ads
View Answers

February 28, 2012 at 2:53 AM


in countries i am getting countries as India, France, Usa



February 29, 2012 at 4:52 PM


1)index.html:

<html>
<form>
<input type="button" value="New Window!" onClick="window.open('subform.html','window','width=400,height=200')">
</form> 
</html> 
<%
String select[] = request.getParameterValues("id"); 
if (select != null && select.length != 0) {
out.println("You have selected: ");
for (int i = 0; i < select.length; i++) {
out.println(select[i]); 
}
}
%>

2)subform.html:

<html>
<form action="index.html">
<pre>
Select Languages: <input type="checkbox" name="id" value="Java"> Java
                  <input type="checkbox" name="id" value=".NET"> .NET
                  <input type="checkbox" name="id" value="PHP"> PHP
                  <input type="checkbox" name="id" value="C/C++"> C/C++
                  <input type="checkbox" name="id" value="PERL"> PERL <BR>
                  <input type="submit" value="Submit">
</pre>
</form>
</html>


February 29, 2012 at 4:54 PM


Change the extension of the code files to jsp.

1)index.jsp:

<html>
<form>
<input type="button" value="New Window!" onClick="window.open('subform.jsp','window','width=400,height=200')">
</form> 
</html> 
<%
String select[] = request.getParameterValues("id"); 
if (select != null && select.length != 0) {
out.println("You have selected: ");
for (int i = 0; i < select.length; i++) {
out.println(select[i]); 
}
}
%>

2)subform.jsp:

<html>
<form action="index.jsp">
<pre>
Select Languages: <input type="checkbox" name="id" value="Java"> Java
                  <input type="checkbox" name="id" value=".NET"> .NET
                  <input type="checkbox" name="id" value="PHP"> PHP
                  <input type="checkbox" name="id" value="C/C++"> C/C++
                  <input type="checkbox" name="id" value="PERL"> PERL <BR>
                  <input type="submit" value="Submit">
</pre>
</form>
</html>

Ads









Related Tutorials/Questions & Answers:
popup window checkbox and sbumit button
popup window checkbox and sbumit button  Hi, Requirement: popup window having multiple checkboxes, I have to select couple of checkboxes and click the submit button. I am unable to get the check box values... need help
Popup Window Example in JavaScript
Popup Window Example in JavaScript       In this article you learn popup Window in java script. Three kinds of  popup windows are available in java script
Advertisements
Popup Window using Ajax In JSP
on View Database button, popup Window will be displayed... Popup Window using Ajax In JSP  ... Database" button. New Pop window winopenradio.jsp will open which
Flex - Call JavaScript Function And Open a Popup Window that Displays Data
Flex - Call JavaScript Function And Open a Popup Window that Displays Data  Flex - Call JavaScript Function And Open a Popup Window that Displays Data
PopUp Button in Flex
button and  smaller buttons, which is called pop-up button. The main button is called control button. When we click a pop-up button opens a second control called the pop-up control. After selecting any pop-up button, the button control
After Clicking Image I need Popup Window - Design concepts & design patterns
After Clicking Image I need Popup Window  Hi Friends. when i click any image button , i need to display popup window in javascript.can u give code for this New Document EMPLOYEE DETAILS
checkbox
checkbox  how to insert multiple values in database by using checkbox in jsp
Tomahawk popup tag
;    This tag is used to create the popup window... attributes to display the popup window at a certain place i.e. we can set its... set when to close this window either when triggering element is left or the popup
iphone Button Action (changing background of window)
iphone Button Action (changing background color of window)   In this tutorial we will change the background color on clicking the button, This is Window Based application. Final application will look like this: In .h
Radio Button in Java
by the user. The AWT  Widget used to create a radio button is Checkbox. The Checkbox class is used by the AWT to create both Radio Button and Checkbox... a RadioButton,we need to create a Checkbox first, followed by adding Radio Button
how to add components (like button , checkbox etc) in a table column in core java
how to add components (like button , checkbox etc) in a table column in core java  plz tell me how to add components(like button, checkbox, radiobutton etc)in a table column in core java
Window
Window  how to create an window of a person like regestration form
popup registration form
popup registration form  hi i want a code for popup registration form.when user click a button popup form will appear.thanks.
Dojo Checkbox
Dojo Checkbox          In this section, you will learn how to create a checkbox in dojo. For creating checkbox you require "dijit.form.CheckBox". The checkbox button do
Display Data from database in Popup Window Using Ajax in JSP
Display Data from database in Popup Window Using Ajax in JSP...;Select" button on page 'windowopen.jsp' the pop up window will close... : To open pop up window click on the button "View Record"
Popup dialog box in java
= new JFrame("Show popup Dialog Box"); JButton button = new JButton("Click...Popup dialog box in java  How to display popup dialog box in java?   Dialog Box- A dialog box is an independent small window which appear
CheckBox component in Echo3
application development are CheckBox, ListBox, Button and RadioButton. Here in this Check Box example we will describe you how to create CheckBox component in Echo3... CheckBox component in Echo3   
Populating values from Child Popup Jsp to Parent jsp
the checkbox of a particular record and clicks OK button in popup jsp then popup...Populating values from Child Popup Jsp to Parent jsp  Hi, My requirement follows like this.. I have a parent jsp where u have search button. If u
refresh checkbox jframe
refresh checkbox jframe  How to refresh checkbox button in JFrame
UIButton checkbox
UIButton checkbox  iPhone UIButton checkbox example required.. can any one please explain me.. how to create a checkbox button using UIButton in XIB
javascript calendar popup code
javascript calendar popup code  javascript calendar popup code
how to show popup in javascript
how to show popup in javascript  How to show popup in javascript
Checkbox method
Checkbox method  what is the method to check if the checkbox is checked
JavaScript Open Modal Window
i.e. original window and new opened window. Here we are going to open a popup... the button, a new window will get open which does not allow the user... JavaScript Open Modal Window
JSP CheckBox
to select multiple languages using checkbox.  After submitting the button... JSP CheckBox          JSP CheckBox is used to create a CheckBox in JSP
Chat window
Chat window  Hi .. In a chat application , on click of a button the chat window pops up.. It is a div in the chat homepage.. There are few other... in the same application. I want to know how to retain the chat window (along
Baloon Popup in GWT
Baloon Popup in GWT  Hi, I am working on making a weekly Calendar in GWT.Here i need to show a Popup on mouse over event on any appointment already added.This popup should be a bubble pop up with an arrow/stem at its one
jQuery modal popup
jQuery modal popup  i want the full source code for modal popup for registration and inserting the data in the database using jdbc and oracle
window closing
window closing  hello, In my project i have login,logout... script. and i need one solution that,when ever user trying to close browser window ,one confirm box will appear and if he clicked ok button then logout.jsp should
Radio Button In Java
on the checkbox button. A check box group button in a CheckboxGroup can be in the "... Radio Button In Java       Introduction In this section, you will learn how to create Radio Button
Checkbox
Checkbox       A checkbox is again a label which is displayed as a pushbutton as shown in the example... of the checkbox is either true or false. However, the initial state is false
Tutorials   
Java Spring Hibernate Struts Training code for programming How can I dynamically load user-entered data as content of jquery dialog? java webcam integration question java coding Fix Scrollbar position in a checkboxList after postback Information Save Alert Country wise redirection to files Interface in javascript connect database with javascript Zip Code ZipCode how to validate the email login How to play FLV video files on Ipad using HTML code or javascript code? Nitobi Grid is not working in IE10/IE11 jquery issue plese help RegEx Tree structure from json whose parents can be dragged and dropped from child newyorklife insurance getElementById not working javascript code for search in html file Implement The Skeleton Code Implement This Skeleton Code Mobile Automation using Appium Computer forensic application Java: Searching a string from doc files java linked list urgent !!! java linked list urgent!!! library management library management library management library management question Html form using JavaScript to display the table content java how to prevent no from unroundin off on clicking text box again in JSP and Jquery graph generation from xml design file display data from database in textbox when id entered in textbox Javascript Code for all fields how to get HTTP GET request value using javascript array Javascript Querry autocomplete(): Spring mvc with jquery: I am not getting correct value in the text filed. Please help me Create SpreadSheet same as excel using java applet Create SpreadSheet same as excel using java applet How to change focus among multiple select boxes? Write JQUERY Code Write JQUERY Code Converting jsp variable to java variable java

Ads

 
Advertisement null

Ads