[this.selectedIndex].value"> validate

This is a discussion on "[this.selectedIndex].value"> validate" within the Web Page Design section. This forum, and the thread "[this.selectedIndex].value"> validate are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Feb 8th, 2008, 19:32
saltedm8's Avatar
Lead Administrator
Join Date: Nov 2005
Location: Always About
Age: 27
Posts: 1,435
Blog Entries: 1
Thanks: 1
Thanked 6 Times in 6 Posts
[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,$m1$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
Last Blog Entry: Basic Advice for newbies (Feb 1st, 2008)
Reply With Quote

  #2 (permalink)  
Old Feb 8th, 2008, 20:08
alexgeek's Avatar
Technical Administrator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,790
Blog Entries: 9
Thanks: 0
Thanked 2 Times in 2 Posts
Re: [this.selectedIndex].value"> validate

Moving to accessibility.
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Reply With Quote
  #3 (permalink)  
Old Feb 8th, 2008, 20:09
alexgeek's Avatar
Technical Administrator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,790
Blog Entries: 9
Thanks: 0
Thanked 2 Times in 2 Posts
Re: [this.selectedIndex].value"> validate

Try wrapping the <select> with a <p> tag.
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Reply With Quote
  #4 (permalink)  
Old Feb 8th, 2008, 20:17
saltedm8's Avatar
Lead Administrator
Join Date: Nov 2005
Location: Always About
Age: 27
Posts: 1,435
Blog Entries: 1
Thanks: 1
Thanked 6 Times in 6 Posts
Re: [this.selectedIndex].value"> validate

bugger me, thank you - how the hell did you know that ?
Last Blog Entry: Basic Advice for newbies (Feb 1st, 2008)
Reply With Quote
  #5 (permalink)  
Old Feb 8th, 2008, 20:44
alexgeek's Avatar
Technical Administrator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,790
Blog Entries: 9
Thanks: 0
Thanked 2 Times in 2 Posts
Re: [this.selectedIndex].value"> validate

Quote:
missing one of "p"
Kinda says it
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Reply With Quote
  #6 (permalink)  
Old Feb 8th, 2008, 20:56
saltedm8's Avatar
Lead Administrator
Join Date: Nov 2005
Location: Always About
Age: 27
Posts: 1,435
Blog Entries: 1
Thanks: 1
Thanked 6 Times in 6 Posts
Re: [this.selectedIndex].value"> validate

lol, i must be really thick - thanks again
Last Blog Entry: Basic Advice for newbies (Feb 1st, 2008)
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a "tag" system to find relevant "related" pages MrQuestions PHP Forum 3 Mar 20th, 2008 23:06
[SOLVED] Show "Image" Depends On User "Status"? Monie Classic ASP 6 Oct 16th, 2007 01:22
? IS "meta name="robots" content="?" necessary in pages ? Love2Java Starting Out 6 Aug 8th, 2007 13:48
window.opener.document["nameForm"].getElementById("someid").value; doesnt work drpompeii JavaScript Forum 0 Feb 17th, 2007 23:09
<option value="yes" class="x"> problem in Firefox mameha1977 Web Page Design 1 Jun 21st, 2006 11:20


All times are GMT. The time now is 13:29.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43