Jenny,
I would recommend an alternative approach. With this method, you are going
to be reloading the entire page after every onchange in your form. That's
going to be quite annoying in itself, regardless of the user not jumping to
the proper point on the page.
I would recommend you implement AJAX (I use ajaxCFC by Rob Gonda). There
are other implementations of it as well. Then you would do something like
this:
<input name="height" type="text" class="inputNumber" id="height"
onChange="doProcess();" <Cfif
isdefined("session.height")>value="#session.height#" </cfif> />
In your javascript you have:
Function doProcess() {
.... here you make your ajax call....
}
Function callBackFunction(result) {
// here you don't need anything unless you want to display something
on the page AFTER you have run your CF code.
}
Of course, you'll need to put your CF code in a CFC and reference that CFC
with the proper ajaxCFC syntax as exampled in the ajaxCFC zip file.
If you have any questions, let us know. Plenty of us on here use ajaxCFC
and there is an ajaxCFC yahoo support group as well.
All these updates will now take place in background and your user won't even
know it.
Dave
-----Original Message-----
From: Jenny Gavin-Wear [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 30, 2008 4:11 PM
To: CF-Talk
Subject: RE: Form question
Hi Adrian,
Many thanks for the helpful reply, I'm still not very conversant with
Javascript.
An example of the code I've used is:
<input name="height" type="text" class="inputNumber" id="height"
onChange="document.forms['process'].submit();" <Cfif
isdefined("session.height")>value="#session.height#" </cfif> />
How would I need to change the syntax, please?
Jenny
-----Original Message-----
From: Adrian Lynch [mailto:[EMAIL PROTECTED]
Sent: 30 July 2008 17:58
To: CF-Talk
Subject: RE: Form question
In the function that fires onchange, add the #place to the action of the
form.
Something like:
function refreshMyForm() {
this.form.action += "#myPlace";
}
<select onchange="refreshMyForm()">
....
</select>
That needs tidying up and made better but that's the basic idea.
Adrian
-----Original Message-----
From: Jenny Gavin-Wear [mailto:[EMAIL PROTECTED]
Sent: 30 July 2008 17:29
To: CF-Talk
Subject: Form question
I'm working on a quotation page. I have a long (very) form and when elements
in the form change I need it to process a cftag.
I have this working pretty well using onchange to submit the form, but it's
pretty horrible for the user to be returned to the top of the page after
each submit/page reload.
Is there a way I could have the user come back to an anchor after each
reload, and to be able to specify the anchor for each onchange?
I hope I've explained this clearly enough,
Thanks in advance,
Jenny
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:309984
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4