CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> Archive -> CodeCharge.Discussion

 Submit a form from a Link?

Print topic Send  topic

Author Message
keijen
Posted: 09/09/2002, 6:21 PM

CC 2.05, vbscript(ASP) and Templates.

I'm trying to submit a record form by a link, then go to the URL of the
link.
In the Before Show Event of the record form, I have a correctly working
label
(set to HTML) to act as the link thus..
fldProjMileStone = "<a href = 'MajorMile.asp?ProjectId="& fldprojectID &
"'>Milestones</a>"

If client activates the link, they wish to auto update the current form
without need to hit update button first.
I've tried this but no success yet.

Form name is 'initiatives', Destination page is MajorMile.asp.
string1 ="<a href = 'MajorMile.asp?ProjectId="& fldprojectID & "'"
string2 = " onclick= " & """document.Initiatives.FormAction.value =
'update';"
string3 =" document.initiatives.submit()" & """"
string4 = ">Milestones</a>"
fldProjMilestone = string1 & string2 & string3 & string4

Clues appreciated as to how can I update the form from the link?

TIA
keijen


Sixto Luis Santos
Posted: 09/09/2002, 6:56 PM


Technically speaking, you can't.

Having said that, there are ways to deal around the issue. For example, you
can simulate that by using javascript. In the following example, we change
the form's action (the default target) to the link's target, and submit the
form. Of course, you must add code to the page to do the actual update.

Another variant is to have a hidden field in the form, change its value
using the same technique, and have the form processor to redirect the page
to the value of the hidden field.


<form name="theform" method="post" action="dafaultpage.asp">
<input type="text" name="thefield" value="">
</form>
<a href="testform.asp?some=value"
onclick="document.theform.action=this.href;document.theform.submit();return
false">This is a link</a>

OR

<form name="theform" method="post" action="dafaultpage.asp">
<input type="text" name="thefield" value="">
<input type="hidden" name="redirect_to" value="">
</form>
<a href="testform.asp?some=value"
onclick="document.theform.redirect_to=this.href;document.theform.submit();re
turn false">This is a link</a>


Regards,

Sixto


"keijen" <keijen@ozemail.com.au> wrote in message
news:aljhf2$jev$1@news.codecharge.com...
> CC 2.05, vbscript(ASP) and Templates.
>
> I'm trying to submit a record form by a link, then go to the URL of the
> link.
> In the Before Show Event of the record form, I have a correctly working
> label
> (set to HTML) to act as the link thus..
> fldProjMileStone = "<a href = 'MajorMile.asp?ProjectId="& fldprojectID &
> "'>Milestones</a>"
>
> If client activates the link, they wish to auto update the current form
> without need to hit update button first.
> I've tried this but no success yet.
>
> Form name is 'initiatives', Destination page is MajorMile.asp.
> string1 ="<a href = 'MajorMile.asp?ProjectId="& fldprojectID & "'"
> string2 = " onclick= " & """document.Initiatives.FormAction.value =
> 'update';"
> string3 =" document.initiatives.submit()" & """"
> string4 = ">Milestones</a>"
> fldProjMilestone = string1 & string2 & string3 & string4
>
> Clues appreciated as to how can I update the form from the link?
>
> TIA
> keijen
>
>
>

keijen
Posted: 09/10/2002, 7:43 PM

Thanks Sixto,
I note your examples have the link outside the form tags; whereas my
non-functioning 'autoupdate' link is inside the form tags.
I'll look at shifting the link outside the form tags in the form footer
area.
Here's hoping

keijen


"Sixto Luis Santos" <sixto@tecnoapoyo.com> wrote in message
news:aljjg5$ms2$1@news.codecharge.com...
>
> Technically speaking, you can't.
>
> Having said that, there are ways to deal around the issue. For example,
you
> can simulate that by using javascript. In the following example, we change
> the form's action (the default target) to the link's target, and submit
the
> form. Of course, you must add code to the page to do the actual update.
>
> Another variant is to have a hidden field in the form, change its value
> using the same technique, and have the form processor to redirect the page
> to the value of the hidden field.
>
>
> <form name="theform" method="post" action="dafaultpage.asp">
> <input type="text" name="thefield" value="">
> </form>
> <a href="testform.asp?some=value"
>
onclick="document.theform.action=this.href;document.theform.submit();return
> false">This is a link</a>
>
> OR
>
> <form name="theform" method="post" action="dafaultpage.asp">
> <input type="text" name="thefield" value="">
> <input type="hidden" name="redirect_to" value="">
> </form>
> <a href="testform.asp?some=value"
>
onclick="document.theform.redirect_to=this.href;document.theform.submit();re
> turn false">This is a link</a>
>
>
> Regards,
>
> Sixto
>
>
> "keijen" <keijen@ozemail.com.au> wrote in message
>news:aljhf2$jev$1@news.codecharge.com...
> > CC 2.05, vbscript(ASP) and Templates.
> >
> > I'm trying to submit a record form by a link, then go to the URL of the
> > link.
> > In the Before Show Event of the record form, I have a correctly working
> > label
> > (set to HTML) to act as the link thus..
> > fldProjMileStone = "<a href = 'MajorMile.asp?ProjectId="& fldprojectID
&
> > "'>Milestones</a>"
> >
> > If client activates the link, they wish to auto update the current form
> > without need to hit update button first.
> > I've tried this but no success yet.
> >
> > Form name is 'initiatives', Destination page is MajorMile.asp.
> > string1 ="<a href = 'MajorMile.asp?ProjectId="& fldprojectID & "'"
> > string2 = " onclick= " & """document.Initiatives.FormAction.value =
> > 'update';"
> > string3 =" document.initiatives.submit()" & """"
> > string4 = ">Milestones</a>"
> > fldProjMilestone = string1 & string2 & string3 & string4
> >
> > Clues appreciated as to how can I update the form from the link?
> >
> > TIA
> > keijen
> >
> >
> >
>
>


   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.