Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JavaScriptQuestions popup window checkbox and sbumit button
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


srini anumala
popup window checkbox and sbumit button
3 Answer(s)      2 years and 10 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);

}


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


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
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
checkbox
checkbox  how to insert multiple values in database by using checkbox in jsp
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
Pop Up window - WebSevices
Pop Up window  How refresh pop up window,Tell me correct code for this problem.  Hi friend, I am sending a link. This link will help you. Visit for more information. http://www.roseindia.net/jsp/popup-window
 

 

 

DMCA.com