Selectbox/dropdownbox

Questions about how to use the online - editors and suggestions how to improve them
Post Reply
maeg
Posts: 525
Joined: Fri Feb 20, 2009 2:27 pm
Location: Agerbæk, Denmark
Contact:

Selectbox/dropdownbox

Post by maeg » Tue Oct 23, 2012 5:11 pm

Hi

I'm wondering if it is possibel to create a selectbox in the content of a side. With the editor it seems not to be a option.

A selectbox like the one that is in use in ex.templateshift plugin.

I know the Way to kode it in a normal php or HTML page.

Have a Nice Day

Best regards

Jens

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Selectbox/dropdownbox

Post by cmb » Tue Oct 23, 2012 5:44 pm

Hi Jens,
maeg wrote:I'm wondering if it is possibel to create a selectbox in the content of a side. With the editor it seems not to be a option.
The following works fine with tinyMCE:

Code: Select all

<select><option value="1">one</option><option value="2">two</option></select>
What exactly do you want to insert?

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

maeg
Posts: 525
Joined: Fri Feb 20, 2009 2:27 pm
Location: Agerbæk, Denmark
Contact:

Re: Selectbox/dropdownbox

Post by maeg » Sun Oct 28, 2012 7:20 am

Hi
cmb wrote: The following works fine with tinyMCE:

Code: Select all

<select><option value="1">one</option><option value="2">two</option></select>
What exactly do you want to insert?

Christoph
Yes i know that Way to make a select dropdown list, but I can't get it to work so everly contains a link to somthing.

I hope you understand What i mean :)

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Selectbox/dropdownbox

Post by cmb » Sun Oct 28, 2012 10:54 am

Hi maeg,

now I understand. But linking with a selectbox doesn't work with plain (X)HTML, as the content of <option> is restricted to #PCDATA (so no <a> is allowed inside of <option>). To link with a selectbox one has to use Javascript:

Code: Select all

<div><select onchange="window.location.href=this.value">
<option value="#">Browse ...</option>
<option value="?News01">News01</option>
<option value="?News02">News02</option> 
</select></div> 
The obvious drawback: that doesn't work, if JS is enabled in the browser.

An alternative that doesn't require JS, but would rely on HTML/CSS only, would be some kind of dropdown-menu.

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

Post Reply