[ic] Calling flypage from a form

Mike Heins interchange-users@icdevgroup.org
Fri Jun 27 09:34:01 2003


Quoting Jamie Neil (jamie@versado.net):
> > Or, if you need some form of SKU validation, you could use something
> > like this:
> >
> >     <form action="[process]" method="POST">
> >         <input type="hidden" name="mv_todo" value="return">
> >         <input type="hidden" name="mv_click" value="set_nextpage">
> >
> >         [L]Item code[/L]:
> >         <input type="text" name="sku" value="">
> >         <input type="submit" value="[L]Go[/L]">
> >     </form>
> >
> >     [set set_nextpage]
> >         [if type="data" term="products::sku::[cgi sku]"]
> >             mv_nextpage=[cgi sku]
> >         [else]
> >             mv_nextpage=invalid_sku
> >         [/else]
> >         [/if]
> >     [/set]
> 
> Yeah - that was pretty much what I'd been trying to do, but I can't get it
> to work :(
> 

It won't work.

But this will:

<form action="[area flypage]">
<input type=text name=mv_arg>
<input type=submit>
</form>

Better:

[set scrub_arg]
	[calc]
		$Session->{arg} =~ s/^\s+//;
		$Session->{arg} =~ s/\s+$//;
		# If all of your part numbers are upper case
		# $Session->{arg} = uc $Session->{arg};

		# If all of your part numbers are lower case
		$Session->{arg} = lc $Session->{arg};

		## Any other things you might want to do
		return;
	[/calc]
[/set]

<form action="[area flypage]">
<input type=hidden name=mv_action value=back>
<input type=hidden name=mv_click value=scrub_arg>
<input type=text name=mv_arg>
<input type=submit>
</form>

You might have to set page_title a bit differently on flypage:

[tmp page_title]
	[if session arg]
		[description code="[data session arg]"]
	[else]
		[item-description]
	[/else]
	[/if]
[/tmp]

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

I have a cop friend who thinks he ought be able to give a new ticket;
"too dumb for conditions".