Professional Web Applications Themes

autonumber question - Coldfusion - Getting Started

Can I pull an autonumber into a query? I have the job ID number in a database as an autonumber. The user will type the number in the form and press submit. They will go to a form where they can edit the job. I tried pulling with an autonumber but couldn't get it to work....

  1. #1

    Default autonumber question

    Can I pull an autonumber into a query? I have the job ID number in a database
    as an autonumber. The user will type the number in the form and press submit.
    They will go to a form where they can edit the job. I tried pulling with an
    autonumber but couldn't get it to work.

    dthatsme Guest

  2. #2

    Default Re: autonumber question

    You should be able to. By typing in the job id in a text form field, it will
    pull the job id is this what you are trying to do?

    <cfif isDefined('Form.submit')>
    <cfquery name='qJobID' datasource='..'>
    select jobID, jobTitle
    from jobTable
    where jobID='#Form.jobID#'>

    <cfoutput query='qJobID'>
    Job id: #jobID# #jobTitle#
    </cfoutput>

    <cfelse>

    <form>
    <input type='text' name='jobID'>
    <input type='submit' name='submit' value='Submit'>
    </form>

    </cfif>

    Latino Guest

  3. #3

    Default Re: autonumber question

    I'm getting an error: JOBID is undefined in FORM
    on this line:
    where jobID='#Form.jobID#'>



    dthatsme Guest

  4. #4

    Default Re: autonumber question

    You should name your input file form to: jobID

    Can you post your code? It's much easier to get this fixed.
    Latino Guest

  5. #5

    Default Re: autonumber question

    Hi

    I think you are re-directing the form action to the same page.
    and in the same page you are checking the where condition.
    so for the first time page execution for a user ..they wont have the
    form.jobid in that

    what you need to do is :
    <cfif isdefined("form.jobid")>
    write the query here.
    </cfif>
    then it wont gives any error..

    vkunirs Guest

Similar Threads

  1. autonumber troubles
    By JMosey@gmail.com in forum MySQL
    Replies: 4
    Last Post: May 23rd, 01:46 PM
  2. ASP Access Autonumber property
    By mike in forum ASP Database
    Replies: 1
    Last Post: August 11th, 05:44 PM
  3. Replies: 0
    Last Post: August 5th, 01:56 AM
  4. autonumber custom code
    By tina in forum Microsoft Access
    Replies: 0
    Last Post: July 30th, 01:07 AM
  5. Assign autonumber before update
    By kRISSE in forum Microsoft Access
    Replies: 2
    Last Post: July 14th, 01:04 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