[ic] actionmap and mv_nextpage in forms

Mike Heins mike at perusion.com
Mon Aug 25 22:09:39 EDT 2003


Quoting Doug Alcorn (doug at lathi.net):
> I've setup an actionmap (which I think are a great way make urls look
> readable) that uses a url something like
> "foo/12332234/bar/456464646".  Basically I'm trying to relate two
> different types of products together in a single page.  I know the
> actionmap works because I can type in the url and the page loads just
> as I'd expect it to.  I verified that the path is being parsed
> correctly and the page is interpreting the results just like I want.
> 
> The foo product is actually related to a group of bar products.  What
> I'm trying to do is have a page the details the relationship between a
> single foo product and a single bar product.  However, I want to have
> a drop down list that allows the shopper to change the bar product.
> Here's what I have so far:
> 
> <form action="[area process]">
>   <input type="hidden" name="mv_todo" value="refresh" />
>   <select name="mv_nextpage" onchange="this.form.submit();">
> 
>     [query type=list prefix=bar sql="select id, display_name from bar where foo='[scratch foo_code]'"]
> 
>        <option value="foo/[sql-param code]/bar/[bar-param id]">[bar-param display_name]</option>
> 
>     [/query]
> 
>   </select>
>   <input type="submit" value="Switch Bar">
> </form>

mv_nextpage is not a URL -- it is a page name. ActionMap depends on it being the URL
referencing the site.. You need:

<form action="[area process]">
  <input type="hidden" name="mv_todo" value="refresh" />
  <select
		name="mv_nextpage"
		onchange="
			this.form.action=this.options[this.selectedIndex].value;
			this.form.submit();
		">

    [query type=list prefix=bar sql="select id, display_name from bar where foo='[scratch foo_code]'"]

       <option value="[area foo/[sql-param code]/bar/[bar-param id]]">[bar-param display_name]</option>

    [/query]

  </select>
  <input type="submit" value="Switch Bar">
</form>

It won't work without JS, though.

-- 
Mike Heins
Perusion -- Expert Interchange Consulting    http://www.perusion.com/
phone +1.513.523.7621      <mike at perusion.com>

Fast, reliable, cheap.  Pick two and we'll talk.  -- unknown


More information about the interchange-users mailing list