0

Currently I am working on a wordpress site. What I want to do is:

Changing the used contact form (over shortcodes, done by a plugin), everytime the user changes his selection of options provided by a dropdownlist with one form as the default one.

I want to achieve this by using ajax. I could send the Index of the selected option to a php file, but I dont know how exactly I would execute the shortcode in php and return the result to the wp site.

Any information and advice would be great!

user3568224
  • 33
  • 1
  • 8
  • possible duplicate of [How to Use AJAX in a WordPress Shortcode?](http://stackoverflow.com/questions/13498959/how-to-use-ajax-in-a-wordpress-shortcode) – brasofilo Jun 11 '14 at 02:58
  • @brasofilo I´ve read the post, before I asked my question. I did not quite understand all of it. The main part I didnt get was how to run a shortcode in php and return just the html. Any advice on that one or could you tell me which part of your code in the other thread does that? Thanks! – user3568224 Jun 11 '14 at 08:12
  • You should say that in question then *"I've read the following post... etc etc"*. Sorry, I don't understand what's your problem, can you illustrate it with `code`? – brasofilo Jun 11 '14 at 08:16
  • @brasofilo I´ll remember! As you can see from my reputation I am very new to stackoverflow. Thats exactly my problem, I dont know how I should write the code... I want to pass the index of a dropdown list to a php script using ajax (I could do that), then in php, depending on the index I want to run a shortcode tag from a WP Plugin and return the resulting html and display it on the page. So dynamically change, in this case, the contact form depending on a premade choice. Hope that illustrates a bit better. – user3568224 Jun 11 '14 at 08:19

0 Answers0