943,654 Members | Top Members by Rank

Ad:
Feb 10th, 2009
0

page validation

Expand Post »
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>
Similar Threads
Reputation Points: 10
Solved Threads: 0
Junior Poster
shadiadiph is offline Offline
117 posts
since Apr 2008
Feb 10th, 2009
0

Re: page validation

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.
Reputation Points: 562
Solved Threads: 368
Posting Maven
almostbob is offline Offline
2,970 posts
since Jan 2009
Feb 10th, 2009
0

Re: page validation

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.....
Reputation Points: 10
Solved Threads: 2
Newbie Poster
seanansari is offline Offline
15 posts
since Jan 2009
Feb 10th, 2009
0

Re: page validation

-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
Reputation Points: 562
Solved Threads: 368
Posting Maven
almostbob is offline Offline
2,970 posts
since Jan 2009
Feb 10th, 2009
0

Re: page validation

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
Reputation Points: 10
Solved Threads: 0
Junior Poster
shadiadiph is offline Offline
117 posts
since Apr 2008
Feb 10th, 2009
0

Re: page validation

Click to Expand / Collapse  Quote originally posted by almostbob ...
-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
Reputation Points: 562
Solved Threads: 368
Posting Maven
almostbob is offline Offline
2,970 posts
since Jan 2009
Feb 10th, 2009
0

Re: page validation

target= is deprecated.
Reputation Points: 730
Solved Threads: 181
Nearly a Senior Poster
MidiMagic is offline Offline
3,314 posts
since Jan 2007

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in HTML and CSS Forum Timeline: Works in IE7 and looks terrible in Firefox and Safari
Next Thread in HTML and CSS Forum Timeline: CSS unaligned without scroll bar





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC