2 Replies Latest reply on Nov 11, 2006 12:13 AM by BKBK

    Trigger IsDefined with a hyperlink or javascript

    Level 7
      Is there a way to trigger a <cfif IsDefined ('')> using a hyperlink or at
      the end of a javacript block.

      I am attempting to trigger a code block using a hyperlink on the page.
      When clicked the onclick triggers a confirmation pop up box that sets the
      return to true or false.

      If the return is true I would like to then trigger the code block.

      here is the hyper link, the function, and the code I am trying to invoke
      when the return is true:

      <a href="javascript:;" onClick="confirmForm()">Reset IQ Web Password</a>

      <SCRIPT LANGUAGE="JavaScript">
      <!--
      function confirmForm() {
      if (confirm("Are you sure you want to reset your IQ Web Password?"))
      {
      return true;
      }
      else
      alert("Password was not modified.")
      return false;
      }
      //-->
      </SCRIPT>

      <cfif IsDefined ('Change_Pass')>
      <cfset ststring=structNew()>
      <cfloop index="i" from="1" to="6" step="1">
      <cfset a = randrange(48,122)>
      <cfif (#a# gt 57 and #a# lt 65) or (#a# gt 90 and #a# lt 97)>
      <cfset ststring["#i#"]="E">
      <cfelse>
      <cfset ststring["#i#"]=#chr(a)#>
      </cfif>
      </cfloop>
      <cfset stpassword
      ="#ststring[1]##ststring[2]##ststring[3]##ststring[4]##ststring[5]##ststring[6]#">