Link to home
Start Free TrialLog in
Avatar of theworpler
theworpler

asked on

Silly question I think but....



I have a form which submits a few controls to an action
page.


This page calls cfhttp and I wanna see exactly what is being passed to the cfhttp tag.

Unfortunately I can't pop up a javascript alert showing what the action template converts the form input to
just before the call to cfhttp...as the whole page must be produced first.....is that correct?
Avatar of CF_Spike
CF_Spike

You can't use Javascript to show what the form is sending if you want to stop processing of the page before the CFHTTP tag. If you don't mind the cfhttp being fired then you can do the following:

<CFSET formdata = "">
<CFLOOP list="#form.fieldnames#" index="i">
<CFSET formdata = formdata & i & ' - ' & Evaluate('form.' & i) & '\n'>
</CFLOOP>

<SCRIPT>
alert('#formdata#');
</SCRIPT>

If you want to see exactly what is being passed to the action page without firing the cfhttp tag you can do the following:

<CFOUTPUT>
Form data:
<CFLOOP LIST="#form.fieldnames#" index="i">
#i# - #Evaluate('form.' & i)#<BR>
</CFLOOP>
<CFOUTPUT>
<CFABORT>

<CFHTTP...

Spike
ASKER CERTIFIED SOLUTION
Avatar of Yog
Yog

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of theworpler

ASKER

Thanks
I'll try those.

I was just being lazy and wanted to bung some js
at the head of the action page.....
Thanks all!!