Professional Web Applications Themes

Small code problem .. any ideas? - Macromedia ColdFusion

K, so I am trying to create a page on our website where people can go and search through our customer database for customer's near them starting with the state. So, I have 2 cfm pages, one to enter a state as a search query, and another to display the results. Not too complicated really, but so far it isn't working properly. When I publish it and then test it out the search page reloads instead of displaying the results page. I know that the form vairable is being stored because in the address bar I start out with ... ...

Sponsored Links
  1. #1

    Default Small code problem .. any ideas?

    K, so I am trying to create a page on our website where people can go and
    search through our customer database for customer's near them starting with the
    state. So, I have 2 cfm pages, one to enter a state as a search query, and
    another to display the results. Not too complicated really, but so far it
    isn't working properly. When I publish it and then test it out the search page
    reloads instead of displaying the results page. I know that the form vairable
    is being stored because in the address bar I start out with ...
    www.oursite.com/serachpage.cfm ... and after I submit it I get
    www.oursite.com/serachpage.cfm?menu=&state=CA I am pulling the state from the
    database records via a query on the search page that looks like this ...

    <cfquery name="searchstate" datasource="hiddenr">
    SELECT DISTINCT state
    FROM jobs
    ORDER BY state ASC
    </cfquery>

    Then that is spit out into the form via a dropdown box in this code


    <form name="searchform" action="result.cfm" METHOD="post">
    <select name="stateselect">
    <option value=""></option>
    <cfoutput query="searchstate">
    <option VALUE="#state#">
    #state#
    </option>
    </cfoutput>
    </select>
    <input TYPE="submit" value="Search">
    </form>


    Then, on the results page I pass the variable selected in the stateselect
    dropdown box into:

    <cfquery name="search" datasource="hidden">
    SELECT *
    FROM jobs
    WHERE state = '#form.stateselect#'
    ORDER BY city
    </cfquery>

    and output it like so:

    <cfoutput query="search">
    <tr>
    <td>#state#</td>
    <td>#church#</td>
    <td>#city#</td>
    <td>#address#</td>
    </tr>
    </cfoutput>

    Can anyone point out what I have done wrong?


    Sponsored Links
    nevermindthat Guest

  2. #2

    Default Re: Small code problem .. any ideas?

    Looks OK, what there is of it.

    What is the name of the page that has the form on it? If the page name is,
    for example, foo.cfm, do a global search of all your .cfm files for occurrences
    of foo.cfm. Do you have a CFLOCATION anywhere on results.crm?

    jdeline Guest

  3. #3

    Default Re: Small code problem .. any ideas?

    the name of the page is searchpage.cfm, and its the only one. I do'nt have a
    CFLOCATION anywhere on the results page ... basicly what I posted is the core
    of the pages ... all the rest of the code is basicly table stuff and a
    CFINCLUDE for the nav bar and the footer. Would you like to see the entire
    code for both pages? The (broken) page itself can be seen here:
    http://www.churchinteriors.com/searchpage.cfm Thank you :)

    nevermindthat Guest

  4. #4

    Default Re: Small code problem .. any ideas?

    In your searchpage.cfm, you have a form tag with a dropdown for products and services. You don't have a ending form tag for it. That's what causing the issue.


    CFDEBUG Guest

  5. #5

    Default Re: Small code problem .. any ideas?

    Good eye ... that's actually in the header.cfm page that I have in the application.cfm file, thank you :)
    nevermindthat Guest

Similar Threads

  1. Ideas for sharing same code with 2 web sites
    By sugarstudio in forum Coldfusion - Advanced Techniques
    Replies: 7
    Last Post: September 17th, 07:20 PM
  2. code not working..ideas please?
    By Geoff in forum PERL Miscellaneous
    Replies: 17
    Last Post: October 2nd, 09:21 AM
  3. Replies: 0
    Last Post: July 27th, 12:50 PM
  4. #24635 [NEW]: small block of code causes crash, possibly destructor related.
    By eric at cosky dot com in forum PHP Development
    Replies: 0
    Last Post: July 13th, 05:54 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