Using menu as a <select> replacement?
Using menu as a <select> replacement?
Is it possible to set up the menu so it would work as a replacement of the select menu? I can handle setting the selected value with a hidden input set via javascript, but the missing piece is to have the collapsed menu show the selected option (like a <select> would). Is there some parameter I can use to set this, or some additional javascript trickery I can do to make this work?
There is a demo about using the Milonic Menu as a select box and also in the same demo is information on putting a select box in the menu. I think the first is what you want mm_setSelected is the function.
Milonic Menu as a select box Hope this helps
Ruth
Milonic Menu as a select box Hope this helps
Ruth
Hello,
Just to add (since I did the mm_setSelected() function that Ruth mentioned)... Both approaches are a variation on the same theme. Both should work well. It's just that I took my example a little further and actually implemented the solution in a form, using a text field as a "holder" for the value that's selected from the menu item that poses as a select box. As you've already surmised, in a real form implementation, you'd hide the "holder" field and use it's contents in subsequent processing of the form input. The mm_setSelected() function will set the value of the holder field and change the text in the collapsed menu to show the selected value.
Cheers,
Kevin
Just to add (since I did the mm_setSelected() function that Ruth mentioned)... Both approaches are a variation on the same theme. Both should work well. It's just that I took my example a little further and actually implemented the solution in a form, using a text field as a "holder" for the value that's selected from the menu item that poses as a select box. As you've already surmised, in a real form implementation, you'd hide the "holder" field and use it's contents in subsequent processing of the form input. The mm_setSelected() function will set the value of the holder field and change the text in the collapsed menu to show the selected value.
Cheers,
Kevin