Professional Web Applications Themes

Insert date if form field is left empty - Coldfusion - Advanced Techniques

I'm puzzled with the folowing, How do i get an empty field ,retreived from the databse in an form, replaced with another whre for the data is always in the form <cfif IsDefined("FORM.assigned_email") AND #FORM.assigned_email# NEQ ""> '#FORM.assigned_email#' <cfelse> NULL ++++++ on the form i've got a field called "assigned_by" and that data i want to have in this field too, when it is left empty. </cfif>...

Sponsored Links
  1. #1

    Default Insert date if form field is left empty

    I'm puzzled with the folowing,
    How do i get an empty field ,retreived from the databse in an form, replaced
    with another whre for the
    data is always in the form

    <cfif IsDefined("FORM.assigned_email") AND #FORM.assigned_email# NEQ "">
    '#FORM.assigned_email#'
    <cfelse>
    NULL ++++++ on the form i've got a field called "assigned_by" and
    that data i want to have in this field too, when it is left empty.
    </cfif>

    Sponsored Links
    fluiter Guest

  2. #2

    Default Re: Insert date if form field is left empty

    Not sure what your question is.

    Are you asking to display the value that's in assigned_by field when
    assigned_email is null?. You say its retrieved from database but I don't see
    the condition including db column. So not sure what u need.

    CFDEBUG Guest

  3. #3

    Default Re: Insert date if form field is left empty

    If your db supports it, use ifnull, coalesce, or something similar in your
    query.

    Otherwise, do something like this

    if (query.datefield is not "")
    datevariable = dateformat(query.datefield, "mask");
    else
    datevariable = something else;

    Then use value = "#datevariable#" in your input.
    Originally posted by: fluiter
    I'm puzzled with the folowing,
    How do i get an empty field ,retreived from the databse in an form, replaced
    with another whre for the
    data is always in the form

    <cfif IsDefined("FORM.assigned_email") AND #FORM.assigned_email# NEQ "">
    '#FORM.assigned_email#'
    <cfelse>
    NULL ++++++ on the form i've got a field called "assigned_by" and
    that data i want to have in this field too, when it is left empty.
    </cfif>



    Dan Guest

  4. #4

    Default Re: Insert date if form field is left empty

    Thanks for your help , problem fixed.
    fluiter Guest

Similar Threads

  1. Inserting to empty date field
    By createmedia in forum Coldfusion Database Access
    Replies: 13
    Last Post: March 2nd, 06:49 PM
  2. Access data type mismatch for empty form field
    By createmedia in forum Coldfusion Database Access
    Replies: 5
    Last Post: January 27th, 05:24 PM
  3. How to handle empty file field in the form
    By trukhin in forum Coldfusion - Getting Started
    Replies: 7
    Last Post: July 27th, 03:15 PM
  4. Insert data from form field to php page
    By blu_sky in forum Dreamweaver AppDev
    Replies: 2
    Last Post: February 28th, 12:25 AM
  5. Insert Date into Memo Field
    By Dave Elliott in forum Microsoft Access
    Replies: 2
    Last Post: August 2nd, 01:11 AM

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