Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using UDF as action page using onClick()

Status
Not open for further replies.

josel

Programmer
Joined
Oct 16, 2001
Messages
716
Location
US
I am just starting to look into this and my thoughts are not all that clear, but I'll try to be as specific as possible.

Given:
1)A function can be called which will NOT reload a page
2)A function can run any CFML tag

If 1 & 2 are true, then if
3)A called function can reference elements as named within <cfform> and/or <form> tags

If all of the above is true, one can then theorize that instead of submitting form to an action page, a good alternative might be calling a function which will do same a action page with the BENEFIT of not giving users the ability to BACK into already submitted pages. In addition, if one could run other commands after calling UDF (submit function) you can route user to clean page according to whatever applies at that time.

Your expertise and creative genius are more than welcome, as well as, your criticism on this concept.

Thank you all in advance;


Jose Lerebours
If you have the knowledge, consult and educate those who need it! - Jose Lerebours
 
You apparently haven't made even the slightest effort to find out about functions in ColdFusion. Where did you get the idea that your #2 &quot;given&quot; is correct? My docs say that a function can contain only CF Script statements. All you have to do is try it with any CF tag to see that it doesn't work.

 
Also, you cannot use a ColdFusion function (whether built-in or UDF) in an onClick attribute of an HTML form element. The event handlers all must have Javascript code as their values. You prevent users from going back to the previous page by manipulating the history list in the browser. You can do this in Javascript:

location.replace(url);

where url is a string containing the URL of the page to load. The new page overwrites the extisting page in the browser's history list.
 
OK - I guess that clears the smoke off my head 8-)

Please notice I intended to denote &quot;given&quot; as &quot;possibles&quot; not facts; my apologies.

You are right, I have not looked into it. The idea just came to me and while it was hot (now nothing but smoke) I figure and put it out here and see what comes from it.

Thank you for the heads up!

Regards;

Jose Lerebours
If you have the knowledge, consult and educate those who need it! - Jose Lerebours
 
No hard feelings, I hope. Just a little slap in the face to help you remember ;-)
 
None what-so-ever dude!

I have a lot of respect for you and other members of this list. As a newbie, I need those to stay in the right path and learn the tricks of the trade.

Your post here was as informative as those you've posted before on other questions I've asked - So again, thank you!

Sincerely;

Jose Lerebours If you have the knowledge, consult and educate those who need it! - Jose Lerebours
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top