Jump to content

scott100

Members
  • Posts

    1,819
  • Joined

  • Last visited

Everything posted by scott100

  1. I don't think we have access to that. Add this to you printer css
  2. lol I'm reading Patricia Caldwell - Predator Ok ok so you want computer books only I have ebook version of AJAX for Dummies and AJAX something or other
  3. You are using the same variable name twice, change you second code to elements2 or something.I haven't tried it but give this a bash.<script type="text/javascript"><!--elements = document.getElementsByTagName("p");for(i=0;i<=elements.length;i++) { if (elements[i].className == 'a') { elements[i].style.display = 'block'; }}elements2 = document.getElementsByTagName("div");for(i=0;i<=elements2.length;i++) { if (elements2[i].className == 'b') { elements2[i].style.display = 'none'; }}// --></script>
  4. Inline javascript / css has been depricated, external files are recommended But i don't think we want to go there....Hey we have a new guy ->
  5. The problem is not IE it's your code Spot the error?You have only used one = sign not two ==To compair values you must use the double ==Correct code
  6. Try telling the parser that there is character data to follow like so.<script><![CDATA[put all javascript here ...function matchwo()]]></script>
  7. 1st problem - class is a reserved keyword so you cannot use it to define a variblevar class=document.getElementById("Class") var status=document.getElementById("status") 2nd problem - the quotes in document.write was all messed up so i changed it See the bit in Red<HTML><HEAD><script TYPE="text/javascript">function CharCreate(){var Name=prompt("Name Your Character","");var race=document.getElementById("Race");race=race.options[race.selectedIndex].text;var status=document.getElementById("status")status=status.options[status.selectedIndex].text;var str="<FONT SIZE=10><B><CENTER>Dungeons and Dragons Character Creator<BR></CENTER></B></FONT><BR>Name: " + Name + "<BR>Race: " + race + "<BR>Class: " + status;var winPtr = window.open('', '_blank', '');winPtr.document.open();winPtr.document.writeln(str);winPtr.document.close();}</SCRIPT></HEAD><BODY><FORM><SELECT ID="Race"><OPTION SELECTED>~~~RACE~~~<OPTION>Human<OPTION>Elf<OPTION>Half-Elf<OPTION>Orc<OPTION>Halfling</SELECT><SELECT ID="status"><OPTION SELECTED>~~~CLASS~~~<OPTION>Fighter<OPTION>Monk<OPTION>Sorceror<OPTION>Wizard<OPTION>Rogue<OPTION>Cleric<OPTION>Druid</SELECTED><BR><INPUT TYPE="button" VALUE="Make Character" onClick="CharCreate()">Are you using html 4 or something i'll leave that for you to sort out.
  8. Try this, i made a couple of changes<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3c.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html><head> <title>Test Page</title> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> <meta name="robots" content="noindex, nofollow" /><script type="text/javascript">function popitup(url){scrnH=screen.height;scrnW=screen.width;if (scrnW>1200) { scrnH=500;scrnW=500}else if (scrnW>1000 && scrnW<1200) { scrnH=400;scrnW=400 }else { scrnH=300;scrnW=300} newwindow=window.open(url,'name','height='+scrnH+', width='+scrnW+', scrollbars=yes, status=yes, location=no, resize=yes, toolbar=no, directories=no, menubar=no, status=no left=5, top=5'); if (window.focus) {newwindow.focus()} return false;}</script></head><body><p><a href="pop_up.html" onclick="return popitup('pop_up.html')">Pop-up Window</a></p></body></html>
  9. http://www.w3schools.com/html/tryit.asp?fi...ryhtml_redirect
  10. It just tells the xml parser to ignore the javascript between it.http://www.w3schools.com/xml/xml_cdata.asp
  11. I think you misunderstand what vertical-align is, it applies only to inline elements not block.It's not a substitute for html v-align which is used with tables for example when aligning elements.This example is a good visual of what it's about: http://www.htmlhelp.com/reference/css/text...ical-align.html
  12. Yeah i believe that the target attribute has been deprecated. You can use some java script: window.open()
  13. Both functions are explained on the site http://www.w3schools.com/jsref/jsref_indexOf.asphttp://www.w3schools.com/jsref/jsref_charAt.asp
  14. To get the co-ordingates: http://www.w3schools.com/js/tryit.asp?file...ry_dom_event_xyThen add a statement like this to the javascript. then in the body have<div id="blah" style="display:none">hello</div>
  15. Are you sure you copied it over correctly? It was just a straight swap, one external js for another.http://scott100.atspace.com/The%20Shattere...Application.htmScreen Dump
  16. Yes border tag is a gonner and you must now use css, i would suggest you learn that after you get to grips with xhtml.Example: http://www.w3schools.com/css/tryit.asp?fil...ss_border-style Yeah fair point, it's something we talked about a few months back: http://w3schools.invisionzone.com/index.ph...c=5220&st=0And here was the outcome http://dhost.info/profmemberone/Pages/deprecated.php(not sure if Dan got round to finishing it off )
  17. To get positions you would use: use the same for left, width and height.To get the bottom right corner you would need to add the top + height then left + width. You might run into some trouble though as im sure .style.blah returns values with px appended so there actually strings not numbers, you would need to chop px off the end (split()) then convert what's left into a true number (parseInt()).Good luck
  18. Hey sorry i never realised you had posted the js above, i just had a look at it and is this what your after?<!-- Copyright 2005 Bontrager Connection, LLC//// Two places need to be customized.////// Place 1:// Between the quotation marks, specify the name of // your form.var FormName = "app";// Place 2:// Between the quotation marks, specify the field names // that are required. List the field name separated // with a comma.var RequiredFields = "CharacterName,CharacterAge,History,WritingSample,Email";//// No other customization of this JavaScript is required.///////////////////////////////////////////////////////////function ValidateRequiredFields(){var FieldList = RequiredFields.split(",")var BadList = new Array();for(var i = 0; i < FieldList.length; i++) { var s = eval('document.' + FormName + '.' + FieldList[i] + '.value'); s = StripSpacesFromEnds(s); if(s.length < 1) { BadList.push(FieldList[i]); } }if(BadList.length < 1) { return true; }var ess = new String();if(BadList.length > 1) { ess = 's'; }var message = new String('\n\nThe following field' + ess + ' are required:\n');for(var i = 0; i < BadList.length; i++){ if (BadList[i] == "CharacterName"){BadList[i] = "Character Name";} if (BadList[i] == "CharacterAge"){BadList[i] = "Character Age";} if (BadList[i] == "WritingSample"){BadList[i] = "Writing Sample";}message += '\n' + BadList[i];}alert(message);return false;}function StripSpacesFromEnds(s){while((s.indexOf(' ',0) == 0) && (s.length> 1)) { s = s.substring(1,s.length); }while((s.lastIndexOf(' ') == (s.length - 1)) && (s.length> 1)) { s = s.substring(0,(s.length - 1)); }if((s.indexOf(' ',0) == 0) && (s.length == 1)) { s = ''; }return s;}// --> bascially i added this before the alert, if the array equals the condition then stick a space in the middle, i've not tested it with the php but it should work fine as your dynamically changing the values.
  19. Yeah i hear were your coming from, post your code so were working from the same hymn sheet
  20. What is it your trying to do, put a space between the name value pair?If so then you don't add the space onto the end of the name as it will cause problems, what i would do is just add the space dynamically, Something along those lines maybe?
  21. You shouldn't rely on javascript to perform the validation, if the user has it turned off then it'll cause problems.Your priority should be to validate all the info with php, javascript should only used to reduce the amount of requests going to the server by performing client side validation, think of it a luxury.
  22. scott100

    sum integers

    When you retrieve values from the query string they are stored as a sting, that is why you get 11 - it's a string not a number. What you have to do is convert them back to a number before use, use the built in function cint()meal = cint(request("meal"))acm = cint(request("accomodation"))total_cost = meal + acmI've not tested it but im sure it's correct
  23. Yesalert("hello Everyone");EDIT^ this board has chopped out the space Nope, that's for markup only not js
  24. http://www.dynamicdrive.com/dynamicindex1/contextmenu.htm
×
×
  • Create New...