HTML/PHP alternative to Java's JList

Thread Solved

Join Date: Apr 2008
Posts: 68
Reputation: K?! is an unknown quantity at this point 
Solved Threads: 0
K?! K?! is offline Offline
Junior Poster in Training

HTML/PHP alternative to Java's JList

 
0
  #1
Jun 30th, 2009
Hi all

I was wondering if there was something like Java's JList in HTML.
I guess not because I can't find anything like it in the list of the form's input types.
What is the easiest way to provide the functionality of a JList?

Thx in advance.
Greetings, K?!

Ps: I'm pretty new to web development so, uhm, keeping it simple would be appreciated ;-)

EDIT:
I'm having an other question about this.
In Java, it's possible to add classes to the JList (so you can access the class itself when an item is selected in the JList), will this be possible with the alternative I've asked for? And if not, I will probably need to create the class by getting an ID value from the "list's" selected value and then creating the class with data from the database, how would I have to insert ID value's into the list (and access them from the list), without them being visible for the user?
Last edited by K?!; Jun 30th, 2009 at 1:49 pm. Reason: Additional question
Heaven ain't got no ghetto. It's got pearly gates and streets of gold.
Reply With Quote Quick reply to this message  
Join Date: Mar 2004
Posts: 763
Reputation: Phaelax is on a distinguished road 
Solved Threads: 38
Phaelax Phaelax is offline Offline
Master Poster

Re: HTML/PHP alternative to Java's JList

 
1
  #2
Jul 6th, 2009
Here's how you'd create a list:
HTML and CSS Syntax (Toggle Plain Text)
  1. <select name="jlist" onlick="function()" size="3">
  2. <option value="A">Item A</option>
  3. <option value="B">Item B</option>
  4. <option value="C">Item C</option>
  5. </select>

You can only return whatever value you have in the double quotes, but you can use that information to retrieve a specific class if you need. Write a javascript function that runs when a user clicks on the selection. Based on the value selected, you can do "switch" statement perform whatever operations you need. If you have to retrieve information from a database and don't want to have to refresh the page, look into ajax.
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 68
Reputation: K?! is an unknown quantity at this point 
Solved Threads: 0
K?! K?! is offline Offline
Junior Poster in Training

Re: HTML/PHP alternative to Java's JList

 
0
  #3
Jul 6th, 2009
Ok, thx.
I think I'll be trying using Id's as value and then using php to get the classes, ajax would probably give a better result, but since I'm just starting with web development I'm going to try to keep it simple .

Thx again for the clear and useful reply.

Grtz, K?!
Heaven ain't got no ghetto. It's got pearly gates and streets of gold.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC