/SampleApplication/ColdBox3/views/artist/form.cfm

http://github.com/bobsilverberg/ValidateThisColdBoxPlugin · ColdFusion · 67 lines · 64 code · 3 blank · 0 comment · 0 complexity · 8a10ad60d72d96410492dde5b79fe3cb MD5 · raw file

  1. <cfoutput>
  2. <h1>User Maintain</h1>
  3. <cfif rc.ValidationResult.hasErrors()>
  4. <div class="messagebox">
  5. The following problems were found with your form submission:
  6. <ul>
  7. <cfloop array="#rc.ValidationResult.getFailures()#" index="failure">
  8. <li>#failure.Message#</li>
  9. </cfloop>
  10. </ul>
  11. </div>
  12. </cfif>
  13. <form action="#Event.BuildLink( 'artist.save' )#" method="post">
  14. <table>
  15. <tr>
  16. <th>Firstname <cfif StructKeyExists( rc.RequiredFields, "firstname" )><span class="required">*</span></cfif></th>
  17. <td><input type="text" name="firstname" id="firstname" value="#HtmlEditFormat( rc.Artist.getFirstname() )#" /> <cfif rc.ValidationResult.hasErrors( "firstname" )>Error!</cfif></td>
  18. </tr>
  19. <tr>
  20. <th>Surname <cfif StructKeyExists( rc.RequiredFields, "lastname" )><span class="required">*</span></cfif></th>
  21. <td><input type="text" name="lastname" id="lastname" value="#HtmlEditFormat( rc.Artist.getLastname() )#" /> <cfif rc.ValidationResult.hasErrors( "lastname" )>Error!</cfif></td>
  22. </tr>
  23. <tr>
  24. <th>Address <cfif StructKeyExists( rc.RequiredFields, "address" )><span class="required">*</span></cfif></th>
  25. <td><input type="text" name="address" id="address" value="#HtmlEditFormat( rc.Artist.getAddress() )#" /> <cfif rc.ValidationResult.hasErrors( "address" )>Error!</cfif></td>
  26. </tr>
  27. <tr>
  28. <th>City <cfif StructKeyExists( rc.RequiredFields, "city" )><span class="required">*</span></cfif></th>
  29. <td><input type="text" name="city" id="city" value="#HtmlEditFormat( rc.Artist.getCity() )#" /> <cfif rc.ValidationResult.hasErrors( "city" )>Error!</cfif></td>
  30. </tr>
  31. <tr>
  32. <th>State <cfif StructKeyExists( rc.RequiredFields, "state" )><span class="required">*</span></cfif></th>
  33. <td><input type="text" name="state" id="state" value="#HtmlEditFormat( rc.Artist.getState() )#" /> <cfif rc.ValidationResult.hasErrors( "state" )>Error!</cfif></td>
  34. </tr>
  35. <tr>
  36. <th>PostalCode <cfif StructKeyExists( rc.RequiredFields, "postalcode" )><span class="required">*</span></cfif></th>
  37. <td><input type="text" name="postalcode" id="postalcode" value="#HtmlEditFormat( rc.Artist.getPostalCode() )#" /> <cfif rc.ValidationResult.hasErrors( "postalcode" )>Error!</cfif></td>
  38. </tr>
  39. <tr>
  40. <th>Email <cfif StructKeyExists( rc.RequiredFields, "email" )><span class="required">*</span></cfif></th>
  41. <td><input type="text" name="email" id="email" value="#HtmlEditFormat( rc.Artist.getEmail() )#" /> <cfif rc.ValidationResult.hasErrors( "email" )>Error!</cfif></td>
  42. </tr>
  43. <tr>
  44. <th>Phone <cfif StructKeyExists( rc.RequiredFields, "phone" )><span class="required">*</span></cfif></th>
  45. <td><input type="text" name="phone" id="phone" value="#HtmlEditFormat( rc.Artist.getPhone() )#" /> <cfif rc.ValidationResult.hasErrors( "phone" )>Error!</cfif></td>
  46. </tr>
  47. <tr>
  48. <th <cfif rc.ValidationResult.hasErrors( "fax" )>Error!</cfif>>Fax <cfif StructKeyExists( rc.RequiredFields, "fax" )><span class="required">*</span></cfif></th>
  49. <td><input type="text" name="fax" id="fax" value="#HtmlEditFormat( rc.Artist.getFax() )#" /></td>
  50. </tr>
  51. <tr>
  52. <th>Password <cfif StructKeyExists( rc.RequiredFields, "password" )><span class="required">*</span></cfif></th>
  53. <td><input type="text" name="password" id="password" value="#HtmlEditFormat( rc.Artist.getPassword() )#" /> <cfif rc.ValidationResult.hasErrors( "password" )>Error!</cfif></td>
  54. </tr>
  55. <tr>
  56. <th>&nbsp;</th>
  57. <td>
  58. <input type="submit" name="save" id="save" value="save" />
  59. <input type="hidden" name="entityid" id="entityid" value="#HtmlEditFormat( rc.Artist.getArtistId() )#" />
  60. </td>
  61. </tr>
  62. </table>
  63. </form>
  64. </cfoutput>