ColdFusion Forms
===

im trying to make a form that accesses a MYSQL DB and all of this is new to me. i think i might be trying to reach to far for what my understanding is of this. here is my question.

i have a form. in this form i have the connection made to the DB and im able to post to the DB. what im trying to do is that i have a option field with tile 1 tile 2 tile 3 and for each tile id like to have the rest of the fields info to be saved under each tile ID. also id like to be able to pull that tiles info when selecting the tile from the option field.

here is the code i have and please keep in mind im new to all of this. thanks

    <cfform method="post" name="TileAdAdmin" action="index.cfm">
              <cfoutput>
    	          <table width="500px">
                  <tr>
                    <td height="159"><label class="labelStyle">Tile Ads</label></td>
                    <td>
                      Tile Number:<select name="TAID" id="TAID">
                        <option value="0">None</option>
                        <option value="1">Tile 1</option>
                        <option value="2">Tile 2</option>
                        <option value="3">Tile 3</option>
                      </select><br /><br />
                      Headline:
                       <input name="TAHL" type="text" id="TAHL" title="TAHL" value="#variables.ta.TAHL#" maxlength="30" />
                       <br />
                       Image Name: 
                       <input name="TAImage" type="text" id="TAImage" title="TAImage" value="#variables.ta.TAImage#" maxlength="30" />
                       <br />
                       Discription:                   
                       <textarea name="TADiscription" cols="30" rows="6" id="TADiscription" title="VimeoID">#variables.ta.TADiscription#</textarea>                   <br />
                      </td>
                  </tr>
                </table><br />
    			
    	        <input type="hidden" value="#variables.controller#" name="controller">
                <input type="hidden" value="#variables.action#" name="action">
                <input type="Submit" value="Submit" name="Submit" class="formInput">
              </cfoutput>
            </cfform>

and here is my code for the DAO

    <cfcomponent name="TADAO" displayname="" hint="" output="false">

  <cffunction name="read" access="public" returntype="Void" output="false" hint="CRUD method">
    <cfargument name="ta" type="ta" required="yes" />
    
    <cfset var qRead = 0 />
    <cfquery name="qRead" datasource="#Application.dbsource#" >
      SELECT
      	TAID,
        TAHL,
        TAIMAGE,
        TADISCRIPTION
	  FROM
	    T026_TILE_ADS
	</cfquery>
    
    <cfif qRead.RecordCount>
      <cfset arguments.ta.setTAID(qread.TAID) />
      <cfset arguments.ta.setTAHL(qread.TAHL) />
      <cfset arguments.ta.setTAImage(qread.TAIMAGE) />
      <cfset arguments.ta.setTADiscription(qread.TADISCRIPTION) />
	  <cfelse>
      <cfthrow type="emptyRecordset" errorcode="TADAO.read.emptyRecordset" message="Unable to locate the Vimeo data record." />
    </cfif>
  </cffunction>

  <cffunction name="update" access="public" returntype="Void" output="false" hint="CRUD method">
    <cfargument name="TA" type="TA" required="yes" />

    <cfquery name="qUpdate" datasource="#Application.dbsource#">
      UPDATE
        T026_TILE_ADS
      SET
        TAID = <cfqueryparam cfsqltype="cf_sql_numeric" value="#arguments.ta.getTAID()#" />,
        TAHL = <cfqueryparam cfsqltype="cf_sql_varchar" value="#arguments.ta.getTAHL()#" />,
        TAIMAGE = <cfqueryparam cfsqltype="cf_sql_varchar" value="#arguments.ta.getTAImage()#" />,
        TADISCRIPTION = <cfqueryparam cfsqltype="cf_sql_text" value="#arguments.ta.getTADiscription()#" />
     </cfquery>

  </cffunction>

</cfcomponent>

and here is my Component code

    <cfcomponent displayname="ta" hint="" output="false">

	<cfproperty name="TAID" displayname="" type="numeric" />
    <cfproperty name="TAHL" displayname="" type="string" />
    <cfproperty name="TAImage" displayname="" type="string" />
    <cfproperty name="TADiscription" displayname="" type="string" />

    
	<cffunction name="init" access="public" returnType="TA" output="false" hint="">
	  <cfset this.TAID = 0 />
      <cfset this.TAHL = "headline" />
      <cfset this.TAImage = "IMAGE" />
      <cfset this.TADiscription = "Discription" />
      
      <cfreturn this />
	</cffunction>

	<cffunction name="getTAID" access="public" output="false" returntype="numeric">
		<cfreturn this.TAID />
	</cffunction>

	<cffunction name="setTAID" access="public" output="false" returntype="void">
		<cfargument name="TAID" type="numeric" required="true" />
		<cfset this.TAID = arguments.TAID />
		<cfreturn />
	</cffunction>
    
    <cffunction name="getTAHL" access="public" output="false" returntype="string">
		<cfreturn this.TAHL />
	</cffunction>

	<cffunction name="setTAHL" access="public" output="false" returntype="void">
		<cfargument name="TAHL" type="string" required="true" />
		<cfset this.TAHL = arguments.TAHL />
		<cfreturn />
	</cffunction>
    
    <cffunction name="getTAImage" access="public" output="false" returntype="string">
		<cfreturn this.TAImage />
	</cffunction>

	<cffunction name="setTAImage" access="public" output="false" returntype="void">
		<cfargument name="TAImage" type="string" required="true" />
		<cfset this.TAImage = arguments.TAImage />
		<cfreturn />
	</cffunction>
    
    <cffunction name="getTADiscription" access="public" output="false" returntype="string">
		<cfreturn this.TADiscription />
	</cffunction>

	<cffunction name="setTADiscription" access="public" output="false" returntype="void">
		<cfargument name="TADiscription" type="string" required="true" />
		<cfset this.TADiscription = arguments.TADiscription />
		<cfreturn />
	</cffunction>
    
     <cffunction name="dump" access="public" output="true" returntype="void">
      <cfoutput>
  		Tile:         #this.TAID# <br />
        Headline:         #this.TAHL# <br />
        Image:         #this.TAImage# <br />
        Description:         #this.TADescription# <br />
        </cfoutput>
	</cffunction>

</cfcomponent>