page validation

Thread Solved

Join Date: Apr 2008
Posts: 78
Reputation: shadiadiph is an unknown quantity at this point 
Solved Threads: 0
shadiadiph shadiadiph is offline Offline
Junior Poster in Training

page validation

 
0
  #1
Feb 10th, 2009
I am having some more validation issues I have just added a search box to my page i did have it as xhtml strict and it was validating fine once i added this for it produced 50 errors then i changed the doc type to transitional now there are are only two errors it is saying there in no such attribute as onblur or onfocus??

I would really like to keep this as strict but when i keep it as strict there are three errors the two mentioned above and i also says that target="_self" is an invalid attribute.

Any ideas how i can fix this?

HTML and CSS Syntax (Toggle Plain Text)
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>APA</title>
  6. <link rel="stylesheet" type="text/css" href="css/main.css" />
  7. <link rel="stylesheet" type="text/css" href="css/topmenu.css" />
  8. <link rel="stylesheet" type="text/css" href="css/leftmenu.css" />
  9. </head>
  10. <body>
  11.  
  12. <div id="holder">
  13.  
  14. <div id="header">
  15.  
  16. <form action="./search.php" method="get" target="_self">
  17. <table class="search">
  18. <tr><td>
  19. <input type="hidden" value="SEARCH" name="action" />
  20. <input type="hidden" value="en" name="lan" />
  21. <input type="text" name="keyword" class="text" size="12" maxlength="30" value="" onFocus=" if (value == '') {value=''}" onBlur="if (value == '') {value=''}" /></td>
  22. <td><input type="hidden" value="50" name="limit" />
  23. <input type="submit" value="Search" class="button" />
  24. <input type="hidden" value="" name="case" />
  25. <input type="hidden" value="1" name="extracts" />
  26. <input type="hidden" value="25" name="perpage" />
  27. </td></tr>
  28. </table>
  29. </form>
  30.  
  31. </div>
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 1,342
Reputation: almostbob has a spectacular aura about almostbob has a spectacular aura about 
Solved Threads: 163
almostbob's Avatar
almostbob almostbob is offline Offline
Nearly a Posting Virtuoso

Re: page validation

 
0
  #2
Feb 10th, 2009
javascript statements end in ' ; '
strict means you have to complete your javascripts,
HTML and CSS Syntax (Toggle Plain Text)
  1. <input type="text" name="keyword" class="text" size="12" maxlength="30" value="" onFocus=" if (value == '') {value='';}" onBlur="if (value == '') {value='';}" /></td>
not sure if it isnt supposed to be
HTML and CSS Syntax (Toggle Plain Text)
  1. <input type="text" name="keyword" class="text" size="12" maxlength="30" value="" onFocus=" if (self.value== '') {self.value='';}" onBlur="if (self.value == '') {self.value='';}" /></td>
coz I dont write strict, still in html 4.01 trans,
or is it
HTML and CSS Syntax (Toggle Plain Text)
  1. <input type="text" name="keyword" class="text" size="12" maxlength="30" value="" onFocus="JAVASCRIPT:if (self.value== '') {self.value='';}" onBlur="JAVASCRIPT:if (self.value == '') {self.value='';}" /></td>
I have no idea
my javascript sux, incidentally so must yours,
else why 'If this field is blank set this field to blank' (twice)

target='_self' forms take action='self' w3.org-forms
self is redundant,
can be written as action='<?php echo $_SERVER['PHP_SELF']; ?>' (in php) and is equally redundant
<form action=""> will get it back here
Last edited by almostbob; Feb 10th, 2009 at 2:37 pm.
Failure is not an option It's included free
If at first you dont succeed, join the club
Of course its always in the last place you look, you dont keep looking after you find it

Please mark solved problems, solved
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 16
Reputation: seanansari is an unknown quantity at this point 
Solved Threads: 2
seanansari's Avatar
seanansari seanansari is offline Offline
Newbie Poster

Re: page validation

 
0
  #3
Feb 10th, 2009
run the page at validator.w3.org..... and you can find out the code that has to be edited.. the comments provided are self explanatory.....
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 1,342
Reputation: almostbob has a spectacular aura about almostbob has a spectacular aura about 
Solved Threads: 163
almostbob's Avatar
almostbob almostbob is offline Offline
Nearly a Posting Virtuoso

Re: page validation

 
0
  #4
Feb 10th, 2009
-onFocus onBlur
onfocus onblur are lower case keywords in xhtml

At least now I am certain, my javascript is terrible,

please what does setting the field blank if it is blank on mouseover mouseout accomplish
Failure is not an option It's included free
If at first you dont succeed, join the club
Of course its always in the last place you look, you dont keep looking after you find it

Please mark solved problems, solved
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 78
Reputation: shadiadiph is an unknown quantity at this point 
Solved Threads: 0
shadiadiph shadiadiph is offline Offline
Junior Poster in Training

Re: page validation

 
0
  #5
Feb 10th, 2009
thanks almostbob your last comment was perfect onfocus onblur have to be lower case. Yes you are right about my javascript it sucks I hate javascript. The php comment about using php_self well i thought about that before but action has to call search.php anyway thanks for that my page is validating 100% now
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 1,342
Reputation: almostbob has a spectacular aura about almostbob has a spectacular aura about 
Solved Threads: 163
almostbob's Avatar
almostbob almostbob is offline Offline
Nearly a Posting Virtuoso

Re: page validation

 
0
  #6
Feb 10th, 2009
Originally Posted by almostbob View Post
-please what does setting the field blank if it is blank on mouseover mouseout accomplish
my teenager just told me
the script is probably using the onblur onfocus to validate the inputs, but you clipped them before displaying here
he said I should know that
Failure is not an option It's included free
If at first you dont succeed, join the club
Of course its always in the last place you look, you dont keep looking after you find it

Please mark solved problems, solved
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 3,210
Reputation: MidiMagic has a spectacular aura about MidiMagic has a spectacular aura about 
Solved Threads: 164
MidiMagic's Avatar
MidiMagic MidiMagic is offline Offline
Nearly a Senior Poster

Re: page validation

 
0
  #7
Feb 10th, 2009
target= is deprecated.
Daylight-saving time uses more gasoline
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC