Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Custom select menu with wordwrap ability 1

Status
Not open for further replies.

Sleidia

Technical User
May 4, 2001
1,284
FR

Hi guys,

I have a site in which I use many forms with dropdown menus, and the site will be translated into several languages, which means that the translated texts might me much longer than the original one.

So, I'm looking for a good custom select menu offering a way to display wordwrapped text inside every option tag.

Ideally, it should conserve the same attributes/properties as a normal select object, so that I don't have to redo the existing javascript code.

Would you know something that can do this?

Thanks :)
 
I wrote this quickly for another thread, I don't know if it was ever used, but it could potentially get you started...

Note, it's just a start and needs A LOT of work to work properly, but it bascilly simulated a drop down list using css and javascript. The actual item that's selected will need to be populated in a hidden form and a submit button will submit that form using the myForm.submit() event.

Demo Here:
Good Luck





TIP: trying googling the answer before posting, you'll find that more times than not someone else somewhere has had the same request and posted an answer online.
----
I have recently been semi-converted to ensuring all my code (well most of it) works in both javascript and non-javascript enabled browsers
 
Thanks Vic but I need something very stable already and that would require the least amount of work to implement.

 
Sleidia,

Good luck finding that here, this board is for getting help with code you've written, not for getting free code written for you...

TIP: trying googling the answer before posting, you'll find that more times than not someone else somewhere has had the same request and posted an answer online.
----
I have recently been semi-converted to ensuring all my code (well most of it) works in both javascript and non-javascript enabled browsers
 
Never heard of Open Source applications?

I'm not asking for someone to code something for me.
I'm not that stupid, thanks.

I just want to know is someone know about a popular solution that developers use.

It sems that they don't have that on The Yahoo! User Interface Library either.

The best library I've found so far is
Still open to more options.

Thanks
 
Never called you stupid, don't know where you got that from.

It did read like you were looking for someone to write the code for you.

To answer your question, yes I have heard of Open Source. There is lots of it out there and if a simple search on Google (i.e. "wrap text in drop down") can't find me a solution quickly, I'd rather not waste my time looking and just write something that will accomplish the task myself.

This is where someone giving you free code (as I did) comes in - the script is over half written, just needs a few modification which any programmer should be able to do within a single 8 hour shift - Bango, I'd have my solution instead of wasting who knows how many days waiting for someone else to give it to me - that I call lazy and cheap.



TIP: trying googling the answer before posting, you'll find that more times than not someone else somewhere has had the same request and posted an answer online.
----
I have recently been semi-converted to ensuring all my code (well most of it) works in both javascript and non-javascript enabled browsers
 
On 13 Apr 09 20:40 you wrote : "it's just a start and needs A LOT of work to work properly"

Today, you wrote : "the script is over half written, just needs a few modification which any programmer should be able to do within a single 8 hour shift"

Are you the same person? ;)

Now, seriously, I'm not in such a hurry.
 
While there are many DHTML-based select element replacements, I think the issue is going to be finding one that:

it should conserve the same attributes/properties as a normal select object

Granted, I've not looked around, but I'm guessing that finding one that fully supports all properties / methods of a regular select might be asking a bit much.

You might find one that supports the mostly-used subset, e.g. having an 'options' collection, etc... but I'm not sure about a 100% replacement.

Do you have a list of properties / methods that you use that this DHTML replacement must support as a minimum?

Dan




Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 
Hi Dan :)

Sorry, I should habe been more accurate in my statement.
I'm not looking for something "that fully supports all properties / methods of a regular select".
Some of them would be enough.

I simply need to be still able to use things such as values, selected status, getAttribute(), getElementsByTagName().
That's it.

Thanks again :)
 
I've not looked into these in great detail (so don't know specifically if they meet your needs), but at first glance, I like them because:

- They are created gracefully from standard select elements delivered to the page, so those without JS can still use them.

- They support keyboard navigation.




I don't know if you are OK with using a framework such as jQuery, etc, but have a look at the demos, anyway.

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 
Thanks a lot Dan :)

looks very nice. Not sure if their combobox can do wordwrap but I will look further into it.

As for frameworks, I'm using Prototype but I couldn't find anything good using it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top