saltem8 Posted February 8, 2008 Share Posted February 8, 2008 i have this, but i am trying to get it to validate, i have solved most the errors but it is just one that is getting the better of me, here is the code <?php //get this month and year $month = date("n"); $year = date("Y"); $jump = isset($_POST['jump']) ? $_POST['jump'] : (isset($_GET['jump']) ? $_GET['jump'] : $month); require('main.php'); $month_tots = array(); for ($i=1; $i<=12; $i++) $month_tots[$i] = 0; // ensure total for every month $res = mysql_query ("SELECT MONTH(FROM_UNIXTIME(date)) as mth, COUNT(*) AS num FROM form WHERE YEAR(FROM_UNIXTIME(date)) = '$year' GROUP BY mth"); while (list($mth, $num) = mysql_fetch_row($res)) { $month_tots[$mth] = $num; // put month totals in the array } /** * create the dropdown */ echo '<form method="post" action="" > <select name="jump" id="jump" onchange="location.href=this.options[this.selectedIndex].value"> '; foreach ($month_tots as $m => $num) { $sel = $jump==$m ? 'selected="selected"':''; $dt = date ('F Y', mktime(0,0,0,$m, 1, $year)); echo "<option value='index.php?jump=$m' $sel>$dt ($num)</option>"; } echo '</select></form>'; ?> <?php mysql_close($conn); ?> this is the offending line <select name="jump" id="jump" onchange="location.href=this.options[this.selectedIndex].value"> '; and this is the error line 44 column 99 - Error: document type does not allow element "select" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag does anyone know how this can be fixed, thank you Quote Link to comment https://forums.phpfreaks.com/topic/90111-solved-thisselectedindexvalue-validate/ Share on other sites More sharing options...
saltem8 Posted February 8, 2008 Author Share Posted February 8, 2008 wrapped the <select> with a <p> tag and solved it myself, Quote Link to comment https://forums.phpfreaks.com/topic/90111-solved-thisselectedindexvalue-validate/#findComment-462096 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.