943,712 Members | Top Members by Rank

Ad:
Jun 30th, 2009
0

HTML/PHP alternative to Java's JList

Expand Post »
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
Similar Threads
K?!
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
K?! is offline Offline
95 posts
since Apr 2008
Jul 6th, 2009
1

Re: HTML/PHP alternative to Java's JList

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.
Reputation Points: 92
Solved Threads: 51
Practically a Posting Shark
Phaelax is offline Offline
856 posts
since Mar 2004
Jul 6th, 2009
0

Re: HTML/PHP alternative to Java's JList

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?!
K?!
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
K?! is offline Offline
95 posts
since Apr 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in HTML and CSS Forum Timeline: How do websites handle user entered text?
Next Thread in HTML and CSS Forum Timeline: BluHost... Good Start?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC