![]() |
![]() |
![]() |
|||||
![]() |
![]() |
![]() |
![]() |
![]() |
|||
| Welcome
to Tech Support Forum home to more then 136,000 problems solved. Issues
have included: Spyware, Malware, Virus Issues, Windows, Microsoft,
Linux, Networking, Security, Hardware, and Gaming Getting your
problem solved is as easy as: 1. Registering for a free account 2. Asking your question 3. Receiving an answer Registered members: * See fewer ads. * And much more..
|
| Want to know how to post a question? click here | Having problems with spyware and pop-ups? First Steps |
|
|||||||
| Web Design & Programming Discussion of web design, and server-side & client-side scripting |
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 (permalink) |
|
Registered User
|
w3c validating javascript.
Hello :)
I have this little javascript that i am trying to validate with w3c. I recieve two errors with these two lines: document.write('</select>'); document.write('</form>'); Is there a way to get the script to validate or should i use another script instead? Below is the script i am working with in my html document. <script language="JavaScript" type="text/javascript"> <!-- // original code by Bill Trefzger 12/12/96 function go(){ if (document.selecter.select1.options[document.selecter.select1.selectedIndex].value != "none") { location = document.selecter.select1.options[document.selecter.select1.selectedIndex].value } } //--> </script> <script language="JavaScript" type="text/javascript"> <!-- document.write('<form name="selecter"><select name="select1">'); document.write('<option value=none>Choose from a range of our products'); document.write('<option value=none>---------------------------'); document.write('<option value="Music_Albums.html">Music Albums'); document.write('<option value="Loops_Packs.html">Loop Packs'); document.write('<option value="3D_Models.html">3D Models'); document.write('<option value="Vsti_Synth.html">Vsti Synth'); document.write('<option value="Texture_Packs.html">Texture Packs'); document.write('<option value=none>---------------------------'); document.write('<option value="http://www.darkfrog.orcon.net.nz/Products.html">Products'); document.write('<option value="http://www.darkfrog.orcon.net.nz/TOS.html">Terms of service'); document.write('</select>'); document.write('<input type="button" value="Go" onclick="go()">'); document.write('</form>'); // end hiding contents --> </script> |
|
|
|
| Important Information |
|
Join the #1 Tech Support Forum Today - It's Totally Free!
TechSupportForum.com is a leading support website for your computer needs. We offer free, friendly and personalized computer support. Why pay to have your computer fixed when you can do it for free. Join TechSupportforum.com Today - Click Here |
|
|
#2 (permalink) |
|
Design Team
Join Date: Mar 2006
Location: Philadelphia
Posts: 1,541
OS: Windows Vista Home Premium (x64)
|
Hello Cori_Zen. Welcome to TSF!
Maybe the validator is a little picky with the HTML involved. I added the optional closing tag for your options. Here is the new code: <script language="JavaScript" type="text/javascript"> <!-- document.write('<form name="selecter"><select name="select1">'); document.write('<option value="none">Choose from a range of our products</option>'); document.write('<option value="none">---------------------------</option>'); document.write('<option value="Music_Albums.html">Music Albums</option>'); document.write('<option value="Loops_Packs.html">Loop Packs</option>'); document.write('<option value="3D_Models.html">3D Models</option>'); document.write('<option value="Vsti_Synth.html">Vsti Synth</option>'); document.write('<option value="Texture_Packs.html">Texture Packs</option>'); document.write('<option value="none">---------------------------</option>'); document.write('<option value="http://www.darkfrog.orcon.net.nz/Products.html">Products</opstion>'); document.write('<option value="http://www.darkfrog.orcon.net.nz/TOS.html">Terms of service</option>'); document.write('</select>'); document.write('<input type="button" value="Go" onclick="go()">'); document.write('</form>'); // end hiding contents --> </script>
__________________
Nice music blog ![]() Nvu || Notepad++ || Apache || PHP || Keep TSF Alive "The great thing about a computer notebook is that no matter how much you stuff into it, it doesn't get bigger or heavier." |
|
|
|
|
|
#3 (permalink) | |
|
Registered User
|
silly script.
Thanks for the help DJ_Zep,
Im still getting errors lol. 12 of these. Quote:
Navigational pulldown menus in HTML Seems to have some usefull information on the use of drop down menus. I guess if i want to use this script ill have to live with it not validating. From what i read at the above url using javascript can make pages less accessible to those who turn off java in thier browsers and even by providing a handy little tip to say "requires java to be turned on" can prove annoying to the user. Im going back to the drawing board on this one and will look for a better alternative. |
|
|
|
|
![]() |
| Thread Tools | |
|
|