Select DropDown Default

Select DropDown Default

Hi there, i have a program in JSP where i have 2 tables tbl1 which contains the "page" and tbl2 which contains most of the record, in my jsp page i have a one dropdown menu where the user can choose, i.e if the user select PAGE 1 in the dropdown menu, it will display all the content of tbl2 that has the value of PAGE 1 from tbl1. and it is working properly.

the problem is if the user select "View ALL Pages" it will dislay nothing. what i want to do is if the user select the "View ALL Page" from the dropdown menu it will display all the records from my database.

here is my code: index.jsp

</head>  
<body> 
    <h1 style="color:red; text-align: center">Report Table</h1>
    <br>

    <FORM action="HomePage.jsp" method="get">

        <table align="center">
            <tr>

                <th>Select Page</th><td><select name='pageName' onchange="showPageName(this.value)">  
                        <option value="">-=Show All=-</option>  
                        <%
                            Class.forName("com.mysql.jdbc.Driver").newInstance();
                            Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/error_page", "root", "password");
                            Statement stmt = con.createStatement();
                            ResultSet rs = stmt.executeQuery("Select * from pagename");
                            while (rs.next()) {
                        %>

                        <option value="<%=rs.getString(1)%>"><%=rs.getString(2)%></option>  
                        <%
                            }
                        %>
                    </select>

        </table>


        <div id='page'>


        </div>
    </form>
View Answers









Related Tutorials/Questions & Answers:
Select DropDown Default
Select DropDown Default  Hi there, i have a program in JSP where i..., i.e if the user select PAGE 1 in the dropdown menu, it will display all... i want to do is if the user select the "View ALL Page" from the dropdown menu
ModuleNotFoundError: No module named 'dash-dropdown-tree-select'
ModuleNotFoundError: No module named 'dash-dropdown-tree-select'  Hi...: No module named 'dash-dropdown-tree-select' How to remove the ModuleNotFoundError: No module named 'dash-dropdown-tree-select' error? Thanks  
Advertisements
help to select a value from the dropdown list
help to select a value from the dropdown list  I have a html file...("$('#suggestions').hide();", 200); } $('#inputString').select(function() { alert('Handler for .select() called.'); }); function selectText(suggestions
Multiple select dropdown with Ajax
Multiple select dropdown with Ajax This tutorial explains how to create multiple select  dropdown with Ajax  in JSP and Servlet . This example... output as: Again when select one or more category in dropdown
dropdown
dropdown  how to hide textbox field when i deselect from select dropdown
dropdown
dropdown  I have a dropdown having 2 options-"Open"& "closed".When i select "open" option the related rows of data are retrieved from database and same with the other option.My database is Mysql and coding in PHP
How to select default FileFilter when creating a JFileChooser dialog?
How to select default FileFilter when creating a JFileChooser dialog? ... directory say "c:\mydirectory" when browse button is clicked. How to select default FileFilter when creating a JFileChooser dialog? Thanks   Hi
dropdown
dropdown  how to select an item from the dropdownlist when we load the page   Hi Friend, Try the following code:ADS_TO_REPLACE_1 <...;/script> </head> <select name="sel" id="sel" onchange="sel();" > <
Ajax Dropdown
Ajax Dropdown  hi I have One Dropdown that contains 2 options assume A and B,if i select A option then samepage one more Dropdown is their it should display values in german language using DWRUtil Parameter values in ajax. Only
DropDown list
DropDown list  how to get mysql database values into dropdown usign... values into dropdown list. 1)country.jsp: <%@page import="java.sql.*"%>...; <select name='country' onchange="showState(this.value)"> <
DropDown Menu
is the problem.. for example; if i select page 1 in my dropdown menu, and click...DropDown Menu  Hello, i have a program that can view,add,delete... me draw to your my mind my program.. in my homepage which i have a dropdown
ajax+dropdown+table format
ajax+dropdown+table format  HI, i am looking for an ajax application which must contain two dropdown list.In first dropdown if i select a manager name from the first dropdown all the reporties under the selected manager should
Dropdown menus onchange atribute
Dropdown menus onchange atribute  Can I know how do we get the drop down list from database? I want to select a type of vehicle from a drop down... from database and store it into dropdown list. On selecting the value from
dropdown box
dropdown box  i need to have country,state and city in drop down box using ajax and use db2 database   Have a look at the following link: JSP dependent dropdown
change navbar dropdown color in bootstrap
-default .navbar-nav .open .dropdown-menu>li>a,.navbar-default .navbar-nav...change navbar dropdown color in bootstrap  How to change the color of navbar dropdown color in a bootstrap based menu in a website? Thanks  
dropdown cacheing
dropdown cacheing   I need code to create cache for load drop down list from db in struts1 example
html:select in struts - Struts
html select in struts  What is the HTML select in struts default value
DropDown in ajax+jsp
DropDown in ajax+jsp  I have four dropdown if i select first dd...; <select name='country' onchange="showState(this.value)">... = con.createStatement(); ResultSet rs = stmt.executeQuery("Select * from country
about select tag
about select tag  Hi, i have a doubt regarding the usage of select tag,that is,suppose i am having two dropdown boxes,based on the selection of one dropdown item another dropdown item will be displayed without interacting
jsp- database dependent dropdown list
jsp- database dependent dropdown list   i want 2 dropdown list 1- CLASS 2-SECTION both are should come from database. and if i select a class suppose class a the corresponding section dropdown list should retrieve the section
dropdown list in jsf
dropdown list in jsf  I want to add a list box to display the country name from the lists on all countries.When I select for e.g India then in the second list box it will display the states related to India only and the flow
dropdown - JSP-Servlet
dropdown  i want to use dropdown select value in query-string in same page.. Using selected 'name' want to fetch details of that person from database...); } Select Employee Name: <--Select--> Angelina Martina Julia
. Display JavaScript dropdown selected value
;/script> </head> <body> Select any one: <select id="dropdown" name...;/html> Description: Create dropdown list by using select and option tag. Now when.... Display JavaScript dropdown selected value  How to get the selected
binding data with textbox on dropdown click
binding data with textbox on dropdown click  Hello friends,Divyesh here. i have jsp page and i would like to bind data with text box on dropdown click. in dropdown employee id are load.and when we select perticular id than how
jsp dropdown - JSP-Servlet
jsp dropdown  in my table there are 3 fields named orderid ,itemname, itemqty. i want code that fetch orderid in dropdown... on select dropdown get... } } Select
dropdown - JSP-Servlet
dropdown  i have below code for dropdown . now i want to user that textbox value in query at same page... how to get it in a new variable...; } <--Select--> Alto Nano Innova Esteem Centro Scorpio
jsp dropdown refresh - JSP-Servlet
jsp dropdown refresh  Sir Thank u for your jsp code for dependent dropdown list, i used it in different table for data extraction but the probleam during data extraction when i select first drop down its refresh then 2nd
getting values from dropdown list
getting values from dropdown list  I am having a dropdown list which has hardcoded values ( we need it hardcoded only and will not be populated from the database) My question is when i select a particular value it should be pass
Retrieval of Dropdown list
Retrieval of Dropdown list  Hi frnds... Am having problem... ... for eg, let A1,A2,A3,A4 be the values in dropdown.. if i click A1... dropdown.. Am not able to retrive the name for further process... Pls check
Dependant Dropdown Lists
Dependant Dropdown Lists  Hello, I'm trying to create 2 dropdown lists. When the visitor chooses one option from the 1st list it will automatically update the 2nd dropdown. Ive already found some code which i edited but still
select option value
select option value  if i select a value of any drop down then that value should be used in a select query of the next dropdown in jsp????   Here is an example of dependent dropdown box in JSP. The values come from
select option value
select option value  if i select a value of any drop down then that value should be used in a select query of the next dropdown in jsp on same page????   Here is an example of dependent dropdown box in JSP. The values
Default Package
Default Package  Can we import default packages???   Yes, you can import the default packages. But there will be no error or exception, if you will not import default packages. Otherwise, importing packages is must
dropdown list in jsp
dropdown list in jsp  hai, i have static dropdown list.. i want to get the selected value in string variable without jsp regards asha
html dropdown not working firefox
html dropdown not working firefox  I am writing a Dropdown code in HTML which is not working in firefox. What could be the reason as it's perfectly working in IE and Crome. Thanks
creating dropdown lists in jsp
creating dropdown lists in jsp  i want to create two dropdown list which are dependent that is the first box choice have to evaluate the second boxs options
dropdown - JSP-Servlet
dropdown  i want to use dropdown select value in query-string in same...,true) xmlHttp.send(null) } else{ alert("Please Select Employee Id...("address").focus(); alert("Please Select Employee Id
populate dropdown box
populate dropdown box  hi, Is there any ways in which i can populate my dropdown menu with values from 1 to n (n = the value stored in database... item in dropdown menu is 10 then the second dropdown box should contain values
DropDown Department Login
DropDown Department Login  Hi all, I am doing a project using JSP... the departments. Now, my intention is to select the department from the drop... is having the departments in the same table. Bcoz as per the SQL Query select * from
fetch values in dropdown
fetch values in dropdown  in my application i want fetch dropdown values in jsp page through servlet. means i have to fetch the database fields values in array variable of servlet and then i have to print those values in dropdown
creating list in dropdown using struts - Struts
creating list in dropdown using struts   creating list in dropdown using struts : In action class list.add(new LabelValueBean("ID","Name")); In Jsp * Select Item Select In Form : getter
parent and child dropdown
parent and child dropdown  Hi, I have one scenario in spring,i need to populate child drop down,based on parent dropdown using spring mvc and ajax... know how to use it in child drop down.How to set that child dropdown in success
jsp drop down-- select Option
jsp drop down-- select Option  how to get drop down populated...*"%> <html> <form name="form" method="post" > <b>Select a country:</b>&nbsp;</td> <select name="sel"><option value
struts dropdown list
struts dropdown list   In strtus how to set the dropdown list values from database ? I have a ArrayList object and set this object in dropdown jsp page using struts ? please send me jsp code... sample code: **Action
How to change the dropdown values based on other dropdown in itext pdf or in any other?
How to change the dropdown values based on other dropdown in itext pdf or in any other?  How to change the drop down values based on another drop down? For eg: If we select one county, that related states only come, if we select
checkbox with dropdown listbox in jsp
checkbox with dropdown listbox in jsp  i loaded the the data into the drop down listbox in jsp from access database.now i have to add a check box,if it checked means dropdownlist box carryout the data's,else it should
inserting dropdown values into database table
inserting dropdown values into database table   hi i want to insert dropdown values into a database table by using jsp
Want code for 5 dependent dropdown in php
Want code for 5 dependent dropdown in php  I have 5 dds, if i select value from first one then related values are displayed in 2 dd and so on .plz help   Please go through the following link: Visit Here The above link
How to Fetch Data using dropdown option
How to Fetch Data using dropdown option   sir maine jsp pr ek login page banaya jismain branch ka option hai. main agar first dropdown main first year branch select karta hoon to first year ki sari branches ki list second drop
Label n Dropdown Issue
Label n Dropdown Issue  Hi guys, Some how Iam able to receive the data for labels, dropdowns. I created one array with the size of label... with corresponding labels... the last dropdown is overriding the previous one... below

Ads