| | |
HTML/PHP alternative to Java's JList
Please support our HTML and CSS advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Apr 2008
Posts: 68
Reputation:
Solved Threads: 0
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?
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.
•
•
Join Date: Mar 2004
Posts: 763
Reputation:
Solved Threads: 38
Here's how you'd create a list:
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.
HTML and CSS Syntax (Toggle Plain Text)
<select name="jlist" onlick="function()" size="3"> <option value="A">Item A</option> <option value="B">Item B</option> <option value="C">Item C</option> </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.
•
•
Join Date: Apr 2008
Posts: 68
Reputation:
Solved Threads: 0
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?!
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.
![]() |
Similar Threads
- Php's alternative to Java's "this" and "super" (PHP)
- Opening Alphabetical list in html/php? (PHP)
- html vs. php (PHP)
- html vs. php (PHP)
- wht is HTML,PHP,CGI(Common Gateway Interface) (PHP)
Other Threads in the HTML and CSS Forum
- Previous Thread: How do websites handle user entered text?
- Next Thread: BluHost... Good Start?
| Thread Tools | Search this Thread |
appointments asp background backgroundcolor beta browser bug calendar cart cgi code codeinjection corporateidentity css design development displayimageinsteadofflash dreamweaver emailmarketing epilepsy explorer firefox flash form format google griefers hackers hitcounter hover html ide ie7 ie8 iframe image images internet internetexplorer intranet iphone javascript jpeg layout macbook maps marketshare microsoft mozilla multimedia navigationbars news offshoreoutsourcingcompany opacity opera optimization pnginie6 positioning problem scroll seo shopping studio swf swf. textcolor timecolor titletags url urlseparatedwords visual visualization web webdevelopment webform website windows7





