Jump to content

scott100

Members
  • Posts

    1,819
  • Joined

  • Last visited

Everything posted by scott100

  1. The browser will load it after the function is called, so yes there will be a delay for slower machines.Enter javascript Image Preloading - that's your solution for this
  2. Try this, i havent checked it but hopefully it works ok <script language="vbscript"><!-- sub btnFind_onclick() Dim num1,num2, num3, maxnum num1 = Cint(document.forms(0).txtOne.value) num2 = Cint(document.forms(0).txtTwo.value) num3 = Cint(document.forms(0).txtThree.value) maxnum=0 if (num1) > (maxnum) then maxnum=num1 end if if (num2) > (maxnum) then maxnum=num2 end if if (num3) > (maxnum) then maxnum=num3 end if msgbox "The Larger number is: " & maxnum end sub--></script> You could even use a loop to cut out some code
  3. Hey, at the end of the day it's your site, if you don't wan't it to validate then that's up to you, all we can do is advise you on best practises. It is possible to position a table without styles, you just have to put the table inside another one, then on the parent table specify position attributes.<table width="100%" height="100%" border="1"><tr><td align="right" valign="bottom"> <table border="1"> <tr><td>Hello</td><td>Hi</td></tr> <tr><td>Goodbye</td><td>Bye</td></tr> </table></td></tr></table>
  4. What you talking about man :)If your looking to introduce yourself do it here: http://w3schools.invisionzone.com/index.php?showtopic=828
  5. It'll use a stylesheet switcher : http://www.dynamicdrive.com/dynamicindex9/...eetswitcher.htm
  6. scott100

    note.xml

    It's the simple note example used throughout the tutorial: http://www.w3schools.com/xml/xml_syntax.aspHotlink: http://www.w3schools.com/dom/note.xml
  7. I don't think it's possible to use \n within a document.writeIn, probably because you are writing html to the page and \n is not markup language. To create a new line use the <br /> tag.document.writeln('<font size=3 face=verdana>'+name+'</font><br />');document.writeln('<font size=3 face=verdana>'+age+'</font>');You can use \n for things like alert messages, this would insert a new line:alert("I am on \ntwo lines");<font> tag is out of date - check out css for modern techniques.
  8. Have you tried document.title ?<head><title>hi</title><head><body> <script> document.title="hello"; </script></body>
  9. There are some tryit yourselfs on this page that should be what you wanthttp://www.w3schools.com/js/js_obj_date.asp
  10. <BODY TEXT="#FFFFFF" LINK="#FFFF00" VLINK="#33FF33" ALINK="#FF0000" BGCOLOR="#000000">Something like thatAnd no the topic wont get deleted, it just gets moved down the page as new posts appear.
  11. Not yet you don't, go here to learn them http://www.w3schools.com/ so? it doesn't matter that your using a mac. ASP/PHP are run at the server so client machine is irrelevant, as long as you have a browser your jammin'
  12. That's right, when you give the button a label there is no way to tie the two together, you will have to "mark" it some way so that you can access it's innerHTML, i have used span tags with unique id's to give you an idea of how it could work.<head><script>function update(spanId,val){document.getElementById(spanId).innerHTML=val;}</script></head><body><form><input type="radio" name="sox" value="male" onclick="update('male','I am a Man')" /><span id="male">Male</span><br><input type="radio" name="sox" value="female" onclick="update('female','You chose Woman')" /><span id="female">Female: </span></form></body>
  13. ok, try this <head><style type="text/css">body{ background: #00ff00 url('http://www.celebritypicturesarchive.com/pics/m/metallica/metallica-009.jpg') repeat; }</style></head> EDIT if that doesn't work can you give us a link to your page, it may be there is some sort of javascript disabling it or something.
  14. CoolDid you try viewing the image on your page as normal with the <img> tag?like put this on your page<img src="http://www.celebritypicturesarchive.com/pics/m/metallica/metallica-009.jpg" /> Did you see your picture then?
  15. It works ok for me, i can see a guy with a guitar Does this page work for you: http://www.w3schools.com/css/tryit.asp?fil...ycss_background
  16. PHP form processing is easier than you think, the site has an easy to grasp example: http://www.w3schools.com/php/php_forms.aspThen an example of sending an email: http://www.w3schools.com/php/php_mail.asp
  17. I was thinking the same but out of curiosity decided to give it a try, it turns out that this does work. If you pass FuncA() with the parameters A,B or C it will find the element on the page with that name/id. I have tried this will firefox etc and it's all good, in the example i have alerted the value of the element passed.<html><head><script>function FuncA(val1,val2){alert("Value 1="+val1.value+" ; Value 2="+val2.value);}</script></head><body><form><input type="text" name="A" onclick="FuncA(B,C)"><input type="text" name="B" onclick="FuncA(A,C)"><input type="text" name="C" onclick="FuncA(A,B)"></form></body>
  18. Couple of things jonathan, when validating a submitted form you should use the onsubmit event handler in the form tag, not on the button itself, when you were returning false it wasn't making any difference ie the form would always be submitted. What i've done is added the variable sub which is set to false, if the conditional statement is true (no options are the same) then it sets sub to true, i then return the sub variable back to the form because it is expecting it, if the value is true the form gets submitted, if false it doesn't.Should work ok <html><head><script>function checkUniquePrefs() {var sub=false;var list = document.getElementById("select1")var name = list.options[list.selectedIndex].textvar list2 = document.getElementById("select2")var name2 = list2.options[list2.selectedIndex].textvar list3 = document.getElementById("select3")var name3 = list3.options[list3.selectedIndex].textif ((name != name2)&&(name != name3)&&(name2 != name3)) {sub=true;}return sub;}</script></head><body><form id="myform" action="mypage.php" method="post" onsubmit="return checkUniquePrefs()" ><select id="select1"><option value="one">one</option><option value="two">two</option><option value="three">three</option></select><select id="select2"><option value="one">one</option><option value="two">two</option><option value="three">three</option></select><select id="select3"><option value="one">one</option><option value="two">two</option><option value="three">three</option></select><input type="submit" value="Save" /></form></body></html>
  19. Here you go, the old classic http://www.w3schools.com/dhtml/tryit.asp?f...trydhtml_menu10If your a css nut then just replace the tables with lists
  20. Yes, use it's entity name: & :)Incase you come across any others this page should help: http://www.w3schools.com/html/html_entities.asp
  21. If you look here you will see an example of how this can be done.http://w3schools.invisionzone.com/index.ph...indpost&p=16948You could use a loop to cut down the lines of code, it's up to you really.
  22. <div id="nav" style="display:none">That will ensure the menu is always disabled when the page is first viewed or refreshed. I have added this, just change the image using the function that changes the display The function takes care of that, if its not displayed show it, otherwise hide it. Create a function that hides all the menus before showing the one clicked. like: onclick="java script:hideAll();toggleItem('nav')"<script type="text/javascript"> function toggleItem(id) { var x=document.getElementById(id); var y=document.getElementById('pic'); if(x.style.display == 'none'){ x.style.display = 'block'; y.src="http://scott100.atspace.com/on.GIF"; } else{ x.style.display = 'none'; y.src="http://scott100.atspace.com/off1.GIF"; } } </script><body><div id="nav" style="display:none">tables here</div><a href="#" onclick="java script:toggleItem('nav')"><img id="pic" src="http://scott100.atspace.com/off1.GIF" /></a> I have weeded the code right down, it was using cookies and all sorts, this is the bare minimum to make this run.
  23. It doesn't matter what one you learn first IMO, i went from javascript to php but either path is fine.There is a term "unobtrusive JavaScript" - which means a script that does not force itself on users or stand in their way. JavaScript should be used as a “nice to have” item rather than a requirement as it can be disabled.That being said i don't want to put you off javascript, i think it's fab, just don't build anything important that relies on it being available - like navigation.You will find plenty of advanced javascript's if you ask google.
  24. That's true, i stick to vbscript with asp though Hasn't vb been replaced by .net?I prefer the use of curly brakets though, i find it easier to visualise where structures begin/end. Maybe it's just the order i learnd languages though, others may find curly brackets weird.
  25. If you wan't to have one "professionaly made" then yes.Otherwise just make your own
×
×
  • Create New...