Thanks very much, I think I shall write a struts tag by myself! On Thu, Sep 4, 2008 at 9:21 PM, Gabriel Belingueres <[EMAIL PROTECTED]>wrote:
> I believe is not possible to add an event to an <option> tag using the > <s:select> tag. > > 2008/9/4, Mead Lai <[EMAIL PROTECTED]>: > > struts2 tags: <s:select name="list" listKey="k" listValue="v" onclick= > > "javascript:alert('mead');" /> > > > > get the HTML code: > > <select name="list" id="ilistAction_list" onclick= > > "javascript:alert('mead');"> > > <option value="Name0">id0</option> > > <option value="Name1">id1</option> > > <option value="Name2">id2</option> > > </select> > > > > but how to insert javascript function in the <option > value="1">id1</option> > > like that: > > <option value="Name2" onclick="javascript:alert('mead');">id2</option> > > > > > > > > On Thu, Sep 4, 2008 at 10:12 AM, Mead Lai <[EMAIL PROTECTED]> wrote: > > > > > Maybe the question is not clarity clear! > > > > > > if write Html code in the jsp page, it can get the purpose simplely. > > > but I wanne use struts2 tags: <s:select name="list" listKey="k" > > > listValue="v" /> to invoke a javascript function. > > > > > > > > > > > > On Thu, Sep 4, 2008 at 10:00 AM, Gabriel Belingueres < > > > [EMAIL PROTECTED]> wrote: > > > > > >> Don't know if I understand correctly your question, but from what I > > >> understand you want a javascript function that redirect to some web > > >> site when the option is selected? > > >> There are plenty of examples in the web for doing that [1]. > > >> > > >> [1] > > >> > http://www.google.com.ar/search?hl=es&q=javascript+select+redirect&btnG=Buscar&meta= > > >> > > >> 2008/9/3 Mead Lai <[EMAIL PROTECTED]>: > > >> > Hi, > > >> > struts2 <s:select/>How to get a option item which can invoke a > > >> > javascript-function? > > >> > > > >> > the final HTML code show to browser is like following: > > >> > <select name="redirect-select"> > > >> > <option value="http://www.cnn.com">cnn</option> > > >> > <option value="http://www.bbc.com">bbc</option> > > >> > <option value="http://www.facebook.com">book</option> > > >> > <option value="more website" onclick="javascript:alert('invoke > another > > >> > action, get more website');">more website</option> > > >> > </select> > > >> > > > >> > how to get the last option item? > > >> > <option value="more website" onclick="javascript:function();">more > > >> > website</option> > > >> > it can invoke a action or redirect another URL? > > >> > It's Ajax Tag can do this? > > >> > > > >> > -- > > >> > BestRegards, > > >> > Mead > > >> > http://yayisoft.com > > >> > > > >> > > >> --------------------------------------------------------------------- > > >> To unsubscribe, e-mail: [EMAIL PROTECTED] > > >> For additional commands, e-mail: [EMAIL PROTECTED] > > >> > > >> > > > > > > > > > -- > > > BestRegards, > > > Mead > > > http://yayisoft.com > > > > > > > > > > > > -- > > BestRegards, > > Mead > > http://yayisoft.com > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- BestRegards, Mead http://yayisoft.com