This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Dreamweaver > August 2004 > forms, anchors, php and other gardening tips!!





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author forms, anchors, php and other gardening tips!!
Alexander Ross

2004-08-26, 12:19 pm

I have a form in a PHP page.

<form action="dosomething.php" method="post">

I'd like to have more than one submit button, and depending on which one is
clicked, the action of the form changes:

<form action="dosomething.php#button1" method="post">
or
<form action="dosomething.php#button2" method="post">


ideas? questions? comments? concerns? jokes?


Murray *TMM*

2004-08-26, 12:19 pm

I think Marja has an extension on her site for this with clientside js -

http://www.flevooware.nl/dreamweaver

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================

"Alan" <dont_mail_me_period@macromedia.com> wrote in message
news:BD50E0EE.1AD71B%dont_mail_me_period@macromedia.com...
>
>
> can't send the action to an anchor- PHP doesn't work like that.
>
> instead of multiple submit buttons- use one submit button.
> have a group of radio buttons, where the user picks what action to take.
> then at top of the processing php, evaluate what they picked, and execute
> the proper block of code for their choice.
>



Alexander Ross

2004-08-26, 12:19 pm

nope .. she has a "submit form from link" extension .. thx though


"Murray *TMM*" <forums@HAHAgreat-web-sights.com> wrote in message
news:cgfppd$1h2$1@forums.macromedia.com...
> I think Marja has an extension on her site for this with clientside js -
>
> http://www.flevooware.nl/dreamweaver
>
> --
> Murray --- ICQ 71997575
> Team Macromedia Volunteer for Dreamweaver
> (If you *MUST* email me, don't LAUGH when you do so!)
> ==================
> http://www.dreamweavermx-templates.com - Template Triage!
> http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
> http://www.dwfaq.com - DW FAQs, Tutorials & Resources
> http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
> ==================
>
> "Alan" <dont_mail_me_period@macromedia.com> wrote in message
> news:BD50E0EE.1AD71B%dont_mail_me_period@macromedia.com...
one[color=darkred]
execute[color=darkred]
>
>



Alan

2004-08-26, 12:19 pm


>
> I'd like to have more than one submit button, and depending on which one is
> clicked, the action of the form changes:
>
> <form action="dosomething.php#button1" method="post">
> or
> <form action="dosomething.php#button2" method="post">
>
>
> ideas? questions? comments? concerns? jokes?
>
>


can't send the action to an anchor- PHP doesn't work like that.

instead of multiple submit buttons- use one submit button.
have a group of radio buttons, where the user picks what action to take.
then at top of the processing php, evaluate what they picked, and execute
the proper block of code for their choice.

Alan

2004-08-26, 12:19 pm

No- the PHP in the file will execute- starting from the top.
You can't choose code blocks of PHP to run by using a named anchor in the
form's action.

What you could do is pass a variable in the action-
action="processthis.php?do=something"
action="processthis.php?do=somethingelse"

then, same as described before- evaluate what's been passed, and process
accordingly.

> can PHP send a page to an anchor before the headers are sent? I know I can
> do this with javascript, but life would be so much better if I could do this
> php


Alexander Ross

2004-08-26, 12:19 pm

....I realize what I'm trying to do is a wee bit unorthodox, but I assure you
there is a madness to my methods ....

can PHP send a page to an anchor before the headers are sent? I know I can
do this with javascript, but life would be so much better if I could do this
php

Alex

"Alan" <dont_mail_me_period@macromedia.com> wrote in message
news:BD50E0EE.1AD71B%dont_mail_me_period@macromedia.com...
>
is[color=darkred]
>
> can't send the action to an anchor- PHP doesn't work like that.
>
> instead of multiple submit buttons- use one submit button.
> have a group of radio buttons, where the user picks what action to take.
> then at top of the processing php, evaluate what they picked, and execute
> the proper block of code for their choice.
>



Michael Fesser

2004-08-26, 12:19 pm

.oO(Murray *TMM*)

>I think Marja has an extension on her site for this with clientside js -
>
>http://www.flevooware.nl/dreamweaver


Use JS only for additional convenience features, _never_ for basic
functionality.

Micha
Michael Fesser

2004-08-26, 12:19 pm

.oO(Alexander Ross)

>...I realize what I'm trying to do is a wee bit unorthodox,


Not really. You can do whatever you want in your form processing script.
It's not that difficult to perform different actions dependent on which
radio button was selected. There's absolutely no need for unreliable
client-side "action changing".

Micha
Murray *TMM*

2004-08-26, 12:19 pm

But that will work for you, no?

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================

"Alexander Ross" <aross@dosomething.org> wrote in message
news:cgfq9v$23k$1@forums.macromedia.com...
> nope .. she has a "submit form from link" extension .. thx though
>
>
> "Murray *TMM*" <forums@HAHAgreat-web-sights.com> wrote in message
> news:cgfppd$1h2$1@forums.macromedia.com...
> one
> execute
>
>



Alexander Ross

2004-08-26, 12:20 pm

let me explain in greater detail ....

I have a form for adding lessons from a school curriculum into a mysql db.
It asks for unit, title, goal, etc... It also asks for each individual step
(think procedure from your high school sience class: step 1, do something ;
step 2, do another thing; ster 3 ...)

Problem is, there is an indeterminant number of steps per lesson. To remedy
this, I added a "+" button near where the user adds step 1. If they want
another step, they simply press "+". The form is submitted back to the same
page (I make sure the user doesn't loose any of the previously entered
data). The first thing this page does is check if a btn was pushed and if
so, which:

if $_POST['addStep'] then ...
if $_POST['submitEntireLesson'] then ...

Still with me? Next to the "+" I put a named anchor. I would like, after
the user pushes "+" for him/her to be brought back to that section of the
form (i.e. not need to scroll down everytime). I use this technique with 3
seperate sections on the form, and it works great!! Its just annoying to
have to scroll down each time if you're adding 10 steps.

Any suggestions, thoughts, ideas, alternative solutions are welcome

Alex


"Michael Fesser" <netizen@gmx.net> wrote in message
news:mgvmi0d0f9vnl0dj8ncf857hjfosr065m3@4ax.com...
> .oO(Alexander Ross)
>
>
> Not really. You can do whatever you want in your form processing script.
> It's not that difficult to perform different actions dependent on which
> radio button was selected. There's absolutely no need for unreliable
> client-side "action changing".
>
> Micha



Sponsored Links


Copyright 2003 - 2009 forum4designers.com  Software forum  Computer Hardware reviews