Hi there, just looking for some advice on best practice..
I would like to move my forms out of my views to clear things up a
bit..
I was thinking of creating a UDF in the include folder which would
contain all the different forms, for example
<!---Add artist Form--->
<cffunction name="showArtistForm" output="false" returntype="string"
access="public" hint="allow user to insert new artist">
<!---Artist Id Argument--->
<cfargument name="formAction" required="yes" type="any" hint="action
variable for form">
<cfset addArtistForm = '<form name="setArtName"
action="#rc.xehArtEdit#"
method="post">
<fieldset>
<legend>edit artist</legend>
<div>
<label for="artist name">artists
name</label>
<input name="name"
type="text"
value="#event.getValue('rc.name','#rc.name_art#')
#">
</div>
</fieldset>
<input type="submit"
name="submit_me"
value="submit" />
<!---Hidden form field--->
<input name="name_art"
type="hidden"
value="#rc.name_art#" />
</form>
<cfreturn addArtistForm>
</cffunction>
Then i could call the form in the view like so...
#showArtistForm(rc.ex.addArtistAction)#
Is this best practise? Or maybe I should move forms into seperate
viewlets to clear things up?
Thanks