Skip to main content
December 14, 2010
Question

StructCLear function questions

  • December 14, 2010
  • 1 reply
  • 1910 views

hI I have quite a few session and form variables being passed through 3 or 4 pages. I want to be able to allow the user to clear these variables by the use of the StructClear() function. I have a reset button on my form page, but tried several ways to include the function in that button with no success. Is this possible?

I also have a linked text that I could insert this function in as well. I tried the onClick js, but that didnt work either.

Here is the text with the onclick I tried:

<cfscript><a href="template.cfm" onclick="StructClear()"></cfscript>Write Another File</a>


Here is the reset button I would like it in as well.

<cfinput type="reset" name="reset" id="reset" value="Reset" />

Thanks for any help!

    This topic has been closed for replies.

    1 reply

    Participating Frequently
    December 14, 2010

    You can not call server side functions from the client side.  You'd need to use javascript on the client to make an Ajax call to a server side template to do that kind of thing (or post a form to a server side script).

    December 14, 2010

    Well really all I want is for the user(backroom) to be able to clear the form once that page has been built and saved. Have the form variables cleared from some point or some action that she takes after the page has been saved.

    I tried inserting just the structClear function at the bottom of the last page in this application. I've done something wrong since it didnt work.

    Participating Frequently
    December 14, 2010

    I'd need to see some code to help you any further.