[nycphp-talk] OT?: HTML question
Cliff Hirsch
cliff at pinestream.com
Sat Oct 14 08:05:43 EDT 2006
To make it even better, separate the control logic from the
presentation. That way, back could be reverse, etc. I do this in all my
forms since application logic and presentation "word play" are two
distinct things to me. This is what I use:
<form method="post" action="form.php">
<input name="submit[back]" value="reverse" type="submit" />
<input name="submit[next]" value="speed ahead" type="submit" />
<input name="submit[home]" value="no place like home" type="submit" />
</form>
Then, you can have a simple routine that captures submit actions
regardless of the presentation value. You check for the array submit --
count 1 and whitelist against the acceptable values. A multi-row table
can expand upon the theme by using this: submit[edit_3],
submit[delete_3]m submit[edit_5], etc.
Cliff
-----Original Message-----
From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org]
On Behalf Of David Krings
Sent: Saturday, October 14, 2006 6:48 AM
To: NYPHP Talk
Subject: Re: [nycphp-talk] OT?: HTML question
At 09:38 PM 10/13/2006, you wrote:
>Another possible solution to the whole thing is to just use a named
>variable inside of the submit itself + switch on that instead of
>using 3 form blocks:
>
><form method="post" action="form.php">
><input name="submit" value="back" type="submit" />
>
><input name="submit" value="next" type="submit" />
>
><input name="submit" value="home" type="submit" />
></form>
>
>- Jon
Yes!! This is what I was hoping for. Sweet, small, easy and on a level
that
I can comprehend. Look Ma! No DIVs needed!
This is so straight forward that I am really annoyed that I didn't
figure
this out myself.
Thank you very very very much! This makes my day and hopefully will get
me
through the trip to the IKEA store. :7
David K.
_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com
Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php
More information about the talk
mailing list