Submit form and update content from div

Asked

Viewed 45 times

1

I have two select option with districts and counties. Through JSON I can filter the districts with the counties only that now I want to search the database. I want to submit the form with the two choices and update the div which displays the content with the search result. How can I make Javascript (specifically jQuery) display the result correctly?

  • What do you want with jQuery? How is presented your div?

  • i have a div that shows the content corresponding to the category that the user chose now wanted through jquery on that same page that the user filters by district and municipalities and when click search updated the div and shows the contents of the query

  • Read http://www.phpgang.com/how-to-integrate-live-search-in-php-and-mysql-with-jquery_309.html

1 answer

1

You can return a value in the search (more specifically, a single, temporary hash). You create a script that returns the search result of this hash in the form of an array or something that jQuery can read and after a certain period of time causes the hash to be deleted. Thus, the system has a higher security and does not direct interface client->database.

  • Can you give me a more specific example of this feature

  • @Césarsousa well, I am not a PHP programmer, I don’t even know how it works. I will search the internet and answer it more fully.

  • Well I’ve been here programming a little and already getting to work as I wanted, but now I’m facing a problem in research when it’s districts or municipalities that have accents does not return me anything

  • @Césarsousa this is due to encoding. Try using ASCII.

  • But I print the value on the screen and it looks good

  • Exact. The enconding used by Mysql may be UTF-8. I may be wrong, but 90% of the cases are due to this.

  • The enconding in my mysql is in UTF-8 so which should change

  • http://dev.mysql.com/doc/refman/5.0/en/charset-convert.html

Show 3 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.