Form results into DIV
I'm sure this has been discussed many many times, but I'm stuck with no idea what to do. I've looked at using jquery to put the results of my php function into a div with no luck - been staring at it for two days now and been through countless forums.
The form works perfectly, it takes me back to my results page, and displays the results of the form via my PHP function:
<form method="post" class="ui-buttonset" id="searchform" action="../results">
<div id="radio" class="ui-buttonset">
<input type="radio" id="series1" name="cat1" value="6"/><label for="series1">Category 6</label>
<input type="radio" id="series2" name="cat1" value="7"/><label for="series2">Category 7</label>
<input type="radio" id="series3" name="cat2" value="8"/><label for="series3">Category 8</label>
<input type="radio" id="series4" name="cat2" value="9"/><label for="series4">Category 9</label>
<input type="submit" id="submit" name="submit" value="Show Me My Articles" />
The problem is - on my results page, the text "Radio # and Radio2 # aren't displayed in the right place, they're in the upper left of the page - outside of every containing DIV. I've been through many forums on using Ajax to get it to place the output into a div, but I can't seem to get the php function to display in the right DIV. Everything besides the display is working as I need it to.
echo "Radio ".$_POST["cat1"]; echo " Radio2 ".$_POST["cat2"];
It sounds like you are echoing out variable before your templates are processed. First rule this possible cause out. From where are you calling results function exactly?
The function results() is included inside a custom.php file within my Wordpress Template. My form is calling the results function on submit and redirecting to a different page on the site just fine...I hadn't thought about the order it was processing things (makes sense now that you said something about it...thanks!). How do I pipe the variables down into the content DIV rather than them being dumped at the top of the <body> tag? I've looked at jquery and ajax and can't seem to figure out how to do it.
It is difficult to say where the problem lies without looking at the files. If you have file structure like this (header.php, content.php, footer.php). Why can't you just call results function from content.php file? This would definately echo out your data correctly. I do not use Wordpress myself, maybe someone who is using Wordpress might provide better assistance.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)