Help with an IF THEN statement

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

  1. #1

    Default Help with an IF THEN statement

    Hi,

    I want to write an if then statement that will take the first item I choose
    from a dynamic text field in my form and input it into the database as well as
    a second value I have associated with the first.

    i.e. I choose from a dropdown menu " 99214" then click on add button and both
    99214 and the value of 1.1 are placed in the database. 99214 in levelofservice
    and 1.1 in rvu.

    There are actually about 8 or 9 choices in the dropdown and each has a
    different associated value.

    I am not too familiar with conditional statements and the 3 books i have arent
    helping so, if anybody can help, i would appreciate it.

    Thanks,

    Steve


    oppels Guest

  2. Similar Questions and Discussions

    1. If Statement???
      guys i was wondering if anybody here could help me. I have a page done up with all dynamic text and attributes on it that come from a management...
    2. Use of FOR statement
      I am reading through a book on Objects and References and I don't understand this statement: $sum += $_ for split //; I thought a FOR...
    3. AW: if-else-statement
      --On Wednesday, September 03, 2003 11:56 PM +0200 "B. Fongo" <mygrps@fongo.de> wrote: Look at the docs for CGI.pm under pragmas, the -nosticky...
    4. if statement
      I'm trying to write an if statement i have two field, Status and Attendance. "status" value can be active or inactive "Attendance" value is active...
    5. IIF statement
      Assuming the data is being entered via a form, then use the AfterUpdate event of the control that is bound to the signature field. The code you need...
  3. #2

    Default Re: Help with an IF THEN statement

    it would help to know what programming language you are using(PHP ASP CF)
    also what code have you produced already. like showing your if statements
    and where you think they are breaking.

    --
    ....helmut
    helmutgranda.com



    "oppels" <steve@cplains.com> wrote in message
    news:d6879e$uk$1@forums.macromedia.com...
    > Hi,
    >
    > I want to write an if then statement that will take the first item I
    > choose
    > from a dynamic text field in my form and input it into the database as
    > well as
    > a second value I have associated with the first.
    >
    > i.e. I choose from a dropdown menu " 99214" then click on add button and
    > both
    > 99214 and the value of 1.1 are placed in the database. 99214 in
    > levelofservice
    > and 1.1 in rvu.
    >
    > There are actually about 8 or 9 choices in the dropdown and each has a
    > different associated value.
    >
    > I am not too familiar with conditional statements and the 3 books i have
    > arent
    > helping so, if anybody can help, i would appreciate it.
    >
    > Thanks,
    >
    > Steve
    >
    >

    ...helmut Guest

  4. #3

    Default Re: Help with an IF THEN statement

    Thanks for the reply.
    I will show you what I have tried, but don't laugh or call me bad words.....
    like I said I don't know much about this.

    I havent gotten to the point of changing the select box yet as I dont know how
    to do it.

    I'm using an access database, coldfusion mx

    Attached is the code.

    thanks
    steve

    <cfset TodayDate = Now()>
    <cfquery name="levelofservice" datasource="tracker">
    SELECT *
    FROM levelofservice
    </cfquery>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Untitled Document</title>
    </head>

    <body>

    <!--- Set LOS --->
    <cfif IsDefined("FORM.los") AND #FORM.los# NEQ "">
    '#FORM.los#'
    </cfif>
    <cfset los=99214>

    <cfif los IS 99212>
    RVU is .45

    <cfelseif los IS 99213>
    RVU is .67
    <cfelseif los IS 99214>
    RVU is 1.1
    <cfelseif los IS 99202>
    RVU is .88
    <cfelseif los IS 99203>
    RVU is 1.34
    <cfelseif los IS 99394>
    RVU is 1.36
    <cfelseif los IS 99395>
    RVU is 1.36
    <cfelseif los IS 99396>
    RVU is .153
    <cfelseif los IS 99397>
    RVU is 1.71
    <cfelseif los IS 99384>
    RVU is 1.53
    <cfelseif los IS 99385>
    RVU is 1.53
    <cfelseif los IS 99386>
    RVU is 1.88
    <cfelseif los IS 99387>
    RVU is 2.06

    <cfelse>
    NULL

    </cfif>
    <form name="form1" id="form1" method="POST" action="">
    <table width="" border="1" cellspacing="0" cellpadding="5">
    <tr>
    <td colspan="3" bgcolor="#CCCCCC"><div align="center"><strong>RVU
    TRACKER</strong></div></td>
    </tr>
    <tr>
    <td><div align="center"><strong>DOS</strong></div></td>
    <td><div align="center"><strong>LOS</strong></div></td>
    <td><div align="center"><strong>RVU</strong></div></td>
    </tr>
    <tr>
    <td align="center"><input type="text" size="10" name="dos"
    value="<cfoutput>#DateFormat(TodayDate, "mm/dd/yyyy")# </cfoutput>" />
    </td>
    <td align="center"><select name="los">
    <option value=""> </option>
    <cfoutput query="levelofservice">
    <option value="#levelofservice.Proc#">#levelofservice.Proc #</option>
    </cfoutput>
    </select></td>
    <td align="center"><select name="rvu">
    <option value=""> </option>
    <cfoutput query="levelofservice">
    <option value="#levelofservice.WorkRVU#">#levelofservice.W orkRVU#</option>
    </cfoutput>
    </select></td>

    </tr>
    <tr>
    <td colspan="3"><div align="right">
    <input type="submit" name="Submit" value="Submit">
    </div></td>
    </tr>
    </table>
    <input type="hidden" name="MM_InsertRecord" value="form1">
    </form>
    </body>
    </html>

    oppels Guest

  5. #4

    Default Re: Help with an IF THEN statement

    Your logic is wrong, IMHO. You don't really need to insert both values into
    the table. You can insert one value and get the other value by joining the
    main table to the look-up table. Alternatively, if you wanted to write both
    fields to the database, you could use javascript to write the selected
    option of the dropdown list to hidden box and insert the value in hidden box
    into the db.

    --
    Jules
    [url]http://www.charon.co.uk/charoncart[/url]
    Charon Cart 3
    Shopping Cart Extension for Dreamweaver MX/MX 2004



    Julian Roberts Guest

  6. #5

    Default Re: Help with an IF THEN statement

    like I said I really havent a clue. I hope that "IMHO" is a term of endearment. I went to your web site and see you have something similar there but it is written for ASP. Steve
    oppels 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