• Resolved kwmlr439

    (@kwmlr439)


    I was hoping someone could help me in a project that I’m working on. I’m searching for some ideas on how to populate a drop downs on a search form. I am using Word Press platform that runs on PHP MySQL as the back end database. For instance, the form will have U.S States followed by Counties then cities;

    and if for example you select Pennsylvania it will automatically select Pennsylvania counties on the next cell. Ones you select a county then it will do the same thing to the cities and so fourth. Ones you click on the city and hit “Submit or search” It will find the page within your website that you selected for that purpose. An example would be find “Philadelphia” page IF you select Philadelphia and hit search.

    I’m thinking JavaScript or JQuery?

    Thank you guys for all your help!

    I found this very helpful SQL Database full of States, Cities and Zip codes, Exactly what I’m looking for but I’m having a hard time understanding how to use it on WordPress. Please help!!!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Have you used javascript or ajax before? The actual wordpress part of this is minimal but you need some custom php to query your database and some frontend javascript to turn the request into a select box. I’m not sure how the final wordpress search part would work. Are you actually going to create a page for each US city??

    Thread Starter kwmlr439

    (@kwmlr439)

    Tomontoas,

    Thank you for your quick reply I appreciate it. I’m not a tech savvy and that’s why I’m here to get some help from the WP community.

    No, I will be creating US cities pages as well as some other fields that will be included in the form. What I basically want to do will be to create a form on the right side menu of my wordpress theme using a widget. and within the form should be 5 fields and then a submit.

    1st fields will read: Select a state
    2nd field will read: Select a County
    3rd field will read: select a city
    4th field will read: select a company
    5th field will read: Select (Type)
    then the (search or submit button)

    For instance, If anyone that browse through my website will click on Select a state and select Pennsylvania for example, the next field should display all counties in Pennsylvania then ones you select a county the next field will select all cities in the county of PA and so fourth. ones you’re done and hit submit to call in the form to grab the data you requested It will basically take you directly to the page you specified.

    I hope I provided more explanation, Thank you for looking into this, I appreciate it.

    Here is a DEMO of what I’m trying to accomplish: https://www.easywayserver.com/blog/javascript-loading-select-box/

    I will suggest that you need to do a lot of learning or hire a developer https://jobs.wordpress.net

    We can’t build your site for you but we can help you with specific issues where it relates to wordpress.

    Thread Starter kwmlr439

    (@kwmlr439)

    Thanks for the suggestion!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Search form’ is closed to new replies.