<p>Todays Date: <? echo $date; ?></p>
<p>Are you applying for a day, evening, or weekend class?
<select name='date' id='wclass'>
<option value ='day'> Day</option>
<option value ='evening'>Evening</option>
<option value ='weekend'>Weekend</option>
</select>
Program Start Date:
<div id='dates'></div>
<script language="javascript">
$(document).ready(function() {
{ setInterval(function () {
if ($("#wclass").val()=='day')
{ $('#dates').html("<? echo <select name='date'>
<option value ='date1'> $start1 </option>
<option value ='date2'>$start2</option>
<option value ='date3'>$start3</option>
<option value ='date4'>$start4</option>
<option value ='date5'>$start5</option>
<option value ='date6'>$start6</option>
<option value ='date7'>$start7</option>
</select> }?>");}
}, 1000);
});
My issue is that i am not sure how to display php using javascript. The variables are all correct, the issue is to get the php to display as html would in my .html. All i want to do is display the php variables which i fetched in the beginning. So the variables have been defined in php now i want to turn them into a html list based on my javascript. You may notice that the echo is missing quotes, thats because i dont know how to put quotes, i cant use " or ' because they both interup quotes that are already there.
$(...).php()here? Why do you think such a function exists? If it is a plugin that does some magic, then tell us. I think you are missing some basic understanding of when PHP and JavaScript are executed. PHP runs on the server side and JavaScript on the client side. You can generate HTML, text and JavaScript with PHP, but once the data leaves the server, PHP's job is done. Besides, what you wrote is not even valid PHP code.$start1and the rest of those similar variables are constructed? I don't think we have the full picture. Although, as described in my answer below, I'm guessing your problem comes from using short tags (disabled by default) and thus the PHP code isn't running. If the PHP were actually running, you'd be getting errors.