Dreamweaver insert record form wizard change to flash form?

Discussion in 'Programming' started by surfer_sven, Sep 23, 2007.

  1. #1
    Hi

    I'm wondering if it is possible to change the generated forms from the insert and update record wizards in Dreamweaver to flash forms?

    If so could you show me how to make the desired changes using the example below:

    My current Staff Type insertion form code (works fine):

    <cflock scope="Session" type="ReadOnly" timeout="30" throwontimeout="no">
    <cfset MM_Username=Iif(IsDefined("Session.MM_Username"),"Session.MM_Username",DE(""))>
    <cfset MM_UserAuthorization=Iif(IsDefined("Session.MM_UserAuthorization"),"Session.MM_UserAuthorization",DE(""))>
    </cflock>
    <cfif MM_Username EQ "" OR MM_UserAuthorization EQ "" OR ListFind("1",MM_UserAuthorization) EQ 0>
    <cfset MM_referer=CGI.SCRIPT_NAME>
    <cfif CGI.QUERY_STRING NEQ "">
    <cfset MM_referer=MM_referer & "?" & CGI.QUERY_STRING>
    </cfif>
    <cfset MM_failureURL="/achieve_tuition/admin/login.cfm?accessdenied=" & URLEncodedFormat(MM_referer)>
    <cflocation url="#MM_failureURL#" addtoken="no">
    </cfif>
    <cfset CurrentPage=GetFileFromPath(GetTemplatePath())>
    <cfif IsDefined("FORM.MM_InsertRecord") AND FORM.MM_InsertRecord EQ "form1">
    <cfquery datasource="#Request.DSN#">
    INSERT INTO achieve_tuition.staff_type (staff_type)
    VALUES (
    <cfif IsDefined("FORM.staff_type") AND #FORM.staff_type# NEQ "">
    <cfqueryparam value="#FORM.staff_type#" cfsqltype="cf_sql_clob" maxlength="75">
    <cfelse>
    ''
    </cfif>
    )
    </cfquery>
    <cflocation url="/achieve_tuition/admin/staff_type_index.cfm">
    </cfif>

    <form method="post" name="form1" action="<cfoutput>#CurrentPage#</cfoutput>">
    <table align="center">
    <tr valign="baseline">
    <td nowrap align="right">Staff Type Name:</td>
    <td><input type="text" name="staff_type" value="" size="20"></td>
    </tr>
    <tr valign="baseline">
    <td nowrap align="right">&nbsp;</td>
    <td><input type="submit" value="Add"></td>
    </tr>
    </table>
    <input type="hidden" name="MM_InsertRecord" value="form1">
    </form>

    However when I make the following amateur changes to convert the form to flash, it displays fine but on submit nothing is inserted into the database and I receive a HTTP 404 page can not be displayed error:

    <cfform method="post" name="form1" format="Flash" timeout="1800" width="400" height="200" skin="haloblue" action="<cfoutput>#CurrentPage#</cfoutput>">
    <cfinput type="text" name="staff_type" label="Staff Type Name:" value="" size="20">
    <cfinput type="submit" name="submit" value="Add">
    <cfinput type="hidden" name="MM_InsertRecord" value="form1">
    </cfform>

    Any ideas on how to convert this form to a flash form?

    Thanks

    Jon
     
    surfer_sven, Sep 23, 2007 IP