Professional Web Applications Themes

form submit actions - Coldfusion - Advanced Techniques

ok i have a form which updates my table<form action="update.cfm" method="post"> i need to do a few things when the update btn is clicked. 1. when click i need to put the actual date into my table column "datelastupdated" 2. then i need the "facilityname" (which is an update field in my form) to be sent to "Administrator.cfm" also with the "datelastupdated" so in "Administrator.cfm" there will be a list "FacilityName" "DateLastUpdated" "FacilityName" "DateLastUpdated" "FacilityName" "DateLastUpdated" 3. when it get to "Update.cfm" can i auto redirect to "Admin.cfm" Many thanks Craig...

  1. #1

    Default form submit actions

    ok i have a form which updates my table<form action="update.cfm" method="post">
    i need to do a few things when the update btn is clicked.

    1. when click i need to put the actual date into my table column
    "datelastupdated"
    2. then i need the "facilityname" (which is an update field in my form) to be
    sent to "Administrator.cfm" also with the "datelastupdated"

    so in "Administrator.cfm" there will be a list
    "FacilityName" "DateLastUpdated"
    "FacilityName" "DateLastUpdated"
    "FacilityName" "DateLastUpdated"

    3. when it get to "Update.cfm" can i auto redirect to "Admin.cfm"

    Many thanks
    Craig

    macca2727 Guest

  2. #2

    Default Re: form submit actions

    macca2727 wrote: 

    Should be simple enough--either give that field in your database a
    default value of the current date (how you do this will depend on the
    specific database you're using), or pass the date in from CF:
    <cfqueryparam value="#Now()#" cfsqltype="cf_sql_timestamp" />

    The datatype you use (cfsqltype) may be slightly dependent upon your
    specific database as well.
     

    Not sure what you mean by "sent to." If all you need is to pull a list
    on Administrator.cfm you don't really need to "send" the updates to this
    page; rather, you could just run a query when the user hits this page
    that pulls this data. Since what you updated just got committed to the
    database it would pull the data. (Let me know if I'm not understanding
    what you're trying to do.)
     

    <cflocation url="Admin.cfm" addtoken="false" /> should do the trick.

    Matt
    --
    Matt Woodward
    com
    Team Macromedia - ColdFusion
    mpwoodward Guest

  3. #3

    Default Re: form submit actions

    so if i give my microsoft access date column a current date default value, with this only update when the record is edited, if so how do i set the default value?
    macca2727 Guest

Similar Threads

  1. using the redirect command with form actions
    By Orange in forum Coldfusion Database Access
    Replies: 0
    Last Post: October 20th, 04:00 PM
  2. calling two Actions in a form
    By gen23 in forum Macromedia Dynamic HTML
    Replies: 2
    Last Post: May 15th, 12:44 AM
  3. form with alternation of two actions
    By tsirman in forum PHP Development
    Replies: 4
    Last Post: May 16th, 04:05 PM
  4. Replies: 4
    Last Post: September 24th, 12:34 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139