Ask a Question related to Dreamweaver AppDev, Design and Development.

  1. #1

    Default Option Value = NULL

    I have a drop down box with several selections that when submitted, update a
    SQL Server backend database. I'd also like to have an option in the drop down
    box that allows me to pass a NULL value back to the database. A sort of
    "reset" if you will.

    I've tried the code below, but it just writes the word "NULL" to the
    database...not actually a <NULL> value.

    <select name="select">
    <option value="NULL">No Value</option>
    <option value="1">Bill</option>
    <option value="2">Chris</option>
    <option value="3">John</option>
    </select>

    Any help would be greatly appreciated!! Thanks!!

    GP3000 Guest

  2. Similar Questions and Discussions

    1. env Config option and LockDetect option not working with Berkeley DB RPC
      I am currently using Berkeley DB 4.4.20 with Berkeley DB perl module 0.28. I am running the client/server version of Berkeley DB. Here is what my...
    2. NULL NULL Error
      I have run out of things to check for and could use some help. We are on a unix box, CFMX 7, and have started to use the CFDOCUMENT tag. The tag...
    3. "null null" error on line -1
      Hi, A different, new, ocasional error this time. Since we are using CFMX7, occasionally we get this error: " Application Exception Monitor...
    4. Error: ?null? is null or not an object
      eloine: That is a bogus error message in that it probably refers to something you have done (or not done) on the page. So, looking in the...
  3. #2

    Default Re: Option Value = NULL

    <option value="">No Value</option>

    "GP3000" <webforumsuser@macromedia.com> wrote in message
    news:d3m2dh$n6v$1@forums.macromedia.com...
    >I have a drop down box with several selections that when submitted, update
    >a
    > SQL Server backend database. I'd also like to have an option in the drop
    > down
    > box that allows me to pass a NULL value back to the database. A sort of
    > "reset" if you will.
    >
    > I've tried the code below, but it just writes the word "NULL" to the
    > database...not actually a <NULL> value.
    >
    > <select name="select">
    > <option value="NULL">No Value</option>
    > <option value="1">Bill</option>
    > <option value="2">Chris</option>
    > <option value="3">John</option>
    > </select>
    >
    > Any help would be greatly appreciated!! Thanks!!
    >

    Brandon Taylor Guest

  4. #3

    Default Re: Option Value = NULL

    I've tried this solution to no avail...it does not actually pass a NULL value
    back to the database...the record is actually updated with a "space". So if
    you query on the table for all NULLs, the record does not come back. If you
    query on a "space" it comes back.

    GP3000 Guest

  5. #4

    Default Re: Option Value = NULL

    Hi, what you can do is set a default value like "0" then before updating the database, make an IF Statement that checks for that "0", then replace it with NULL.

    It's something like: <option value="0">No Value</option>

    then before updating the database (this is just pseudo-code, modify as needed):
    noValue = dropdownlist.value;
    if (noValue == "0")
    {
    noValue = null;
    }

    Then, update database. You may need to replace the "null" to a null SQL type of the programming language that you're using.

    Hope you pull it off!

    Disso
    Unregistered Guest

Posting Permissions

  • You may not post new threads
  • You may 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