Total members 11343 |It is currently Fri Jul 25, 2014 4:43 am Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

All times are UTC [ DST ]



  filling two comboboxes
Sun Sep 11, 2011 1:53 pm 

i have 2 comboboxes on jsp page.first combobox is been fillin onload and second combobox must be fille by choosing an option from first combobox like :city and countries.
how i can "push" to make the loading data from bean class?


Author:
Newbie
User avatar Posts: 2
Have thanks: 0 time
  Re: filling two comboboxes
Mon Sep 12, 2011 12:48 pm 
can you post your code please.

_________________
Please recommend / share my post if you found it helpful.


Author:
Mastermind
User avatar Posts: 2694
Have thanks: 73 time
  Re: filling two comboboxes
Tue Sep 13, 2011 8:47 am 
<%@page import="shopking.Product"%>
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<html>
<head>
<title>חיפוש מתקדם</title>
<link rel="stylesheet" type="text/css" href="cssFiles\menu.css"/>
<link rel="stylesheet" type="text/css" href="cssFiles\advance_search_page.css"/>
<jsp:useBean id="user" class="shopking.AdvanceSearchClass" scope="page"/>
<%@page import="java.util.ArrayList"%>
<%@page import="shopking.Category"%>

</head>
<body>
<img src="images\web_logos\shopking_logo.png" class="shopking_logo">

<%ArrayList<Category> cc = user.getCategoriesList(); %>

<select name="categoryName" id="categoryName" dir="rtl">
<option value="all">הכל</option>
<% for(int i=0 ;i<cc.size();i++){%>
<option value="<%=cc.get(i).getCategory_Id()%>"><%=cc.get(i).getDescriptionH()%>
</option><%}%></select>:קטגורית חנות

<input type="text" name="FREEtext">:קטגורית מוצרים

<input type="number" id="to" width="3">עד <input type="number" id="from" width="3">מחיר מ


<script>
var categoryP=document.getElementById("categoryName");
categoryP=category.selectedIndex();
var from=document.getElementById(from).valueOf();
var to =document.getElementById(to).value();
<%ArrayList<Product>prodList=user.getProductListByCategory(Integer.parseInt(categoryP), Double.parseDouble(from), Double.parseDouble(to)); %>
<select name="Products" dir="rtl">
<% for(int i=0;i<prodList.size();i++){%>
<option value=<%=i %>><%=prodList.get(i).getProducr_NameH()%></option>
<%}%>
</select>

</script>



</body>
</html>


Author:
Newbie
User avatar Posts: 2
Have thanks: 0 time
Post new topic Reply to topic  [ 3 posts ] 

  Related Posts  to : filling two comboboxes
 Filling JComboBox from database     -  
 ASP.NET code for filling and displaying a DataGrid     -  

All times are UTC [ DST ]









Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team