| Welcome to Webforumz.com. |
|
Feb 8th, 2008, 19:32
|
#1 (permalink)
|
|
Lead Administrator
Join Date: Nov 2005
Location: Always About
Age: 27
Posts: 1,062
|
[this.selectedIndex].value"> validate
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: Select all
<?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
- PHP: Select all
<select name="jump" id="jump" onchange="location.href=this.options[this.selectedIndex].value"> ;
and this is the error
Quote:
|
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
|
|
|
Feb 8th, 2008, 20:08
|
#2 (permalink)
|
|
Administrator
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 4,102
|
Re: [this.selectedIndex].value"> validate
Moving to accessibility.
__________________
Languages: PHP, mySQL (queries), C#, (X)html, CSS, JS.
|
|
|
Feb 8th, 2008, 20:09
|
#3 (permalink)
|
|
Administrator
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 4,102
|
Re: [this.selectedIndex].value"> validate
Try wrapping the <select> with a <p> tag.
__________________
Languages: PHP, mySQL (queries), C#, (X)html, CSS, JS.
|
|
|
Feb 8th, 2008, 20:17
|
#4 (permalink)
|
|
Lead Administrator
Join Date: Nov 2005
Location: Always About
Age: 27
Posts: 1,062
|
Re: [this.selectedIndex].value"> validate
bugger me, thank you - how the hell did you know that ?
|
|
|
Feb 8th, 2008, 20:44
|
#5 (permalink)
|
|
Administrator
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 4,102
|
Re: [this.selectedIndex].value"> validate
Kinda says it 
__________________
Languages: PHP, mySQL (queries), C#, (X)html, CSS, JS.
|
|
|
Feb 8th, 2008, 20:56
|
#6 (permalink)
|
|
Lead Administrator
Join Date: Nov 2005
Location: Always About
Age: 27
Posts: 1,062
|
Re: [this.selectedIndex].value"> validate
lol, i must be really thick - thanks again
|
|
|
| Thread Tools |
|
|
| Rate This Thread |
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|