On 31-01-2009 at 17:04, Peter Wilkins wrote:
> I'm converting an existing site to Stripes and it has a feature I don't 
> know how to "convert" to Stripes.  There is a text box for a user to 
> enter a search string.  To execute the search, the page contains an image 
> map with an onclick event.
>
> What I want to do is pass the contents of the text box to my action bean 
> when the imagemap is clicked.
>
> Any suggestions would be appreciated.
>
> <img src="navtop.gif" alt="Search" width="154" height="139" border="0"  
> usemap="#Map" />
> ...
> <form name="queryform" method=post action="SearchFromHtml"  
> target="_top">
> <div align="left" class="box2" id="box2">
>   <input name="query" type="text"  value=""/>
> </div>
>
>   <map name="Map" id="Map">
>    <area shape="rect" coords="71,35,113,54" href="" alt="Go"  
> onclick="formSubmit();"/>
> </map>
> ...
> </form>

In your form here, I see you submit it by a scipt. You can add an empty
hidden input field with the name of the event to use, or use the default
event handler to handle the event. There is also a special request parameter
"_event" IIRC, where you can explicitly name the event to use, but I'm not
entirely certain on that.

Alternatively, you can use a button tag:
        <button type="submit" name="myEventName"><img src="navtop.gif"
        alt="Search" width="154" height="139"/></button>

The downside of this button is that the entire image becomes clickable. But
the advantage is that you can add specify the entire button content, for
example to include both translated text and an image.


Oscar

-- 
   ,-_  Oscar Westra van holthe - Kind      http://www.xs4all.nl/~kindop/
  /() )
 (__ (  I love deadlines. I like the whooshing sound they make as they fly
=/  ()  by.  -- Douglas Adams

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to