Removing the event from the URL?

0 views
Skip to first unread message

wblakemd

unread,
Jul 29, 2010, 8:31:45 AM7/29/10
to Mach-II for CFML
Hello all,
I have a simple question, or at least I hope it is simple. Let
me explain what I am doing before I ask the question. I have a form
that asks the user some questions, and those questions are submitted
into the database. This is done by the form action calling an event
that enters the data into the DB. Something like:

<form action="index.cfm?event=submit">

This works fine. The event calls a listener which processes the data
and after that completes the user is returned to the form with a
message which lets them know it was submitted correctly. Again, all of
this works fine. However, there is a slight problem. The url still
has the "event=submit" in the address bar. If the user were to go up
to the address bar and hit enter, it would throw an error (which is
actually more desirable over them submitting their data again, or a
bank form).

So here is the question. How do I remove the event information from
the url? I have thought about trying to pass the event information
from a hidden field in the form, but that just seems somehow wrong. I
am very new to M2, so maybe I am doing this wrong from the get-go.
Any thoughts, suggestions are greatly appreciated.

David D-V Tran

unread,
Jul 29, 2010, 9:34:01 AM7/29/10
to mach-ii-for...@googlegroups.com
You could also do an announce event for the handler so after it is submitted it brings up another view.
Since you define what is displayed, just include an announce event or have it redirect to another handler.
 
or

Make the event variable as a hidden field instead of a url parameter.

 
--
You received this message because you are subscribed to Mach-II for CFML list.
To post to this group, send email to mach-ii-for...@googlegroups.com
To unsubscribe from this group, send email to mach-ii-for-coldf...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/mach-ii-for-coldfusion?hl=en

***New URLs as of April 29th, 2010***
SVN: http://svn.mach-ii.com/machii/
Wiki / Documentation / Tickets: http://trac.mach-ii.com/machii/



--
   Dave Tran
   Co-Owner / Founder
   MONUMENT SNOWBOARDS

http://www.monumentsnowboards.com

   Official Phone: 202.630.SNOW  |  202.498.5333
   Fax: 888.238.8340
   Skype: MNMNT_DC
   Email: da...@monumentsnowboards.com

   

Matthew Woodward

unread,
Jul 29, 2010, 9:55:39 AM7/29/10
to mach-ii-for...@googlegroups.com
On Thu, Jul 29, 2010 at 5:31 AM, wblakemd <will_...@hotmail.com> wrote:
However, there is a slight problem.  The url still
has the "event=submit" in the address bar.  If the user were to go up
to the address bar and hit enter, it would throw an error (which is
actually more desirable over them submitting their data again, or a
bank form).

If you use a redirect instead of simply announcing another event the URL will change.

--
Matthew Woodward
ma...@mattwoodward.com
http://blog.mattwoodward.com
identi.ca / Twitter: @mpwoodward

Please do not send me proprietary file formats such as Word, PowerPoint, etc. as attachments.
http://www.gnu.org/philosophy/no-word-attachments.html

Matthew Woodward

unread,
Jul 29, 2010, 10:00:42 AM7/29/10
to mach-ii-for...@googlegroups.com
On Thu, Jul 29, 2010 at 6:55 AM, Matthew Woodward <ma...@mattwoodward.com> wrote:
If you use a redirect instead of simply announcing another event the URL will change.


Sorry, forgot to paste this in:
http://trac.mach-ii.com/machii/wiki/MachII1.8Redirect

wblakemd

unread,
Jul 29, 2010, 3:38:56 PM7/29/10
to Mach-II for CFML
Thanks all!
We are actually using, prepare yourself, Mach-ii v 1.1.1 (or there
about) so the redirect functionality put into 1.8 will not work for
us. However it did give me the idea of doing a redirect using a
<cflocation> tag. I know there is a better way but this works great
for my needs. I also make users clicking the back button less of a
problem.

Before you ask, I have no idea why we are using such an old version of
M2, but if you think that is bad we are still using CF 6.1. LOL

Thanks again for the quick reply's and information.

Will

Peter J. Farrell

unread,
Jul 29, 2010, 3:52:12 PM7/29/10
to mach-ii-for...@googlegroups.com
Actually, the redirect command was added in 1.5 (2007) and IIRC -- 1.5
supports MX 6.1. We did a lot of improvements to redirect in 1.8 but I
think you can take advantage of 1.5 on CF MX 6.1. We work really are
for backwards compatibility so I think you should be able to drop it in,
clear the template cache and restart your CF engine.

.pjf

P.s. You could always use OpenBD or Railo -- which are both free and
open source CFML engines. You'd get your engine to at least CF8 level
of features and plus other nifty things.

wblakemd said the following on 07/29/2010 02:38 PM:

wblakemd

unread,
Jul 29, 2010, 4:09:21 PM7/29/10
to Mach-II for CFML
Good to know. I figured we were still at 1.1.1 because of CF MX 6.1.
I believe we have purchased CF 9, but have yet to install it. We had
to move to Oracle 10 (or was it 11?) before we moved to CF 9. I work
for a sub contractor for the Government, so you can imagine how slow
things move around here. I am glad I got this job because I never
heard of M2 until I got here. Now that I am learning (slowly) I want
to go back and convert all my old apps to use M2!

Thanks for the help.

Reply all
Reply to author
Forward
0 new messages