Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Making the action atribute of the FORM tag dynamic

Reply
Thread Tools

Making the action atribute of the FORM tag dynamic

 
 
Jerry Manner
Guest
Posts: n/a
 
      06-22-2005
Hi

Is it possible to make the action part of the form tag more flexible?
instead of a constant address ( as below)?

<FORM action="ResultTable.htm" method="get">
<p align="left">
<input type="text" name="T1" size="50"><br>
<input type="image" src="ELPic/Logo.gif" alt="submit" width="89"
height="23">
</FORM>

I need this so that under a certain condition, while clicking the logo,
the action is done to another address.
Can the action attribute look like this ' <FORM action=X method="get">'
and that the X variable is set somewhere else?

Regards

 
Reply With Quote
 
 
 
 
JDS
Guest
Posts: n/a
 
      06-22-2005
On Wed, 22 Jun 2005 01:22:32 -0700, Jerry Manner wrote:

> Hi
>
> Is it possible to make the action part of the form tag more flexible?
> instead of a constant address ( as below)?
>
> <FORM action="ResultTable.htm" method="get">
> <p align="left">
> <input type="text" name="T1" size="50"><br> <input type="image"
> src="ELPic/Logo.gif" alt="submit" width="89"
> height="23">
> </FORM>
>
> I need this so that under a certain condition, while clicking the logo,
> the action is done to another address. Can the action attribute look like
> this ' <FORM action=X method="get">' and that the X variable is set
> somewhere else?
>
> Regards


Isn't it funny how very similar questions often seem to get asked in
groups? (See slightly earlier thread posted by "diablo")

In any case...

The answer to your question is "yes, but..."

yes, but you will have to use some sort of server-side scripting to do it.
ASP, PHP, ColdFusion, or similar. I am fairly certain that there is no
client-side solution for this problem.

later...

--
JDS | http://www.velocityreviews.com/forums/(E-Mail Removed)
| http://www.newtnotes.com
DJMBS | http://newtnotes.com/doctor-jeff-master-brainsurgeon/

 
Reply With Quote
 
 
 
 
Jonathan N. Little
Guest
Posts: n/a
 
      06-22-2005
JDS wrote:
<snip code>
>>
>>I need this so that under a certain condition, while clicking the logo,
>>the action is done to another address. Can the action attribute look like
>>this ' <FORM action=X method="get">' and that the X variable is set
>>somewhere else?
>>
>>Regards

>
>
> Isn't it funny how very similar questions often seem to get asked in
> groups? (See slightly earlier thread posted by "diablo")
>
> In any case...
>
> The answer to your question is "yes, but..."
>
> yes, but you will have to use some sort of server-side scripting to do it.
> ASP, PHP, ColdFusion, or similar. I am fairly certain that there is no
> client-side solution for this problem.
>
> later...
>

Yes, you can trap and change the form's action on submit with
JavaScript, BUT if the client has JavaScript disabled (an ever
increasing situation) this will fail. Server-side is only way to be
certain of success.

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
diablo
Guest
Posts: n/a
 
      06-25-2005
Hi

yes and if your using IIS then you may have issues doing it server side as
well. in particular if you do sometig like this

if request.form("submit")="Logo Press" then response.redirect logo_press.asp
else response.redirect some_place_else.asp


then the form post data is not passed on to the redirected page. i found
some stuff to do with 307's...but it all adds to a pain in the ...

D
ps - i guess you could recreate and pop your form on the imbetween page


"Jonathan N. Little" <(E-Mail Removed)> wrote in message
news:bRfue.872$(E-Mail Removed)...
> JDS wrote:
> <snip code>
> >>
> >>I need this so that under a certain condition, while clicking the logo,
> >>the action is done to another address. Can the action attribute look

like
> >>this ' <FORM action=X method="get">' and that the X variable is set
> >>somewhere else?
> >>
> >>Regards

> >
> >
> > Isn't it funny how very similar questions often seem to get asked in
> > groups? (See slightly earlier thread posted by "diablo")
> >
> > In any case...
> >
> > The answer to your question is "yes, but..."
> >
> > yes, but you will have to use some sort of server-side scripting to do

it.
> > ASP, PHP, ColdFusion, or similar. I am fairly certain that there is no
> > client-side solution for this problem.
> >
> > later...
> >

> Yes, you can trap and change the form's action on submit with
> JavaScript, BUT if the client has JavaScript disabled (an ever
> increasing situation) this will fail. Server-side is only way to be
> certain of success.
>
> --
> Take care,
>
> Jonathan
> -------------------
> LITTLE WORKS STUDIO
> http://www.LittleWorksStudio.com



 
Reply With Quote
 
Jonathan N. Little
Guest
Posts: n/a
 
      06-25-2005
diablo wrote:
> Hi
>
> yes and if your using IIS then you may have issues doing it server side as
> well. in particular if you do sometig like this
>
> if request.form("submit")="Logo Press" then response.redirect logo_press.asp
> else response.redirect some_place_else.asp
>
>
> then the form post data is not passed on to the redirected page. i found
> some stuff to do with 307's...but it all adds to a pain in the ...
>
> D
> ps - i guess you could recreate and pop your form on the imbetween page
>
>

<snip>

I avoid IIS as much as possible, but I would suggest then to make
one common receiving script and fork depending on parameters. If there
is overlap, this method might be more efficient than two scripts.

Else on a redirect the receiving script would have to build a query
string to parse the form field values.

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Atribute error gtb Python 2 04-27-2007 12:33 AM
how do u invoke Tag b's Tag Handler from within Tag a's tag Handler? shruds Java 1 01-27-2006 03:00 AM
xml schema: rule between atribute value in one element ocelka XML 2 03-18-2005 06:27 AM
property atribute does not work Bart ASP .Net Building Controls 0 12-15-2004 05:23 PM
Struts Static Action Form vs Dyanamic Action Form Joe Bloggs Java 1 08-03-2003 02:30 AM



Advertisments