Jump to content

Floydian

Members
  • Posts

    116
  • Joined

  • Last visited

    Never

Everything posted by Floydian

  1. Hello young_coder, You can use the file() function to read the csv file into an array. You have line breaks in your csv file, and each line will be an element in the array. Then you can use shuffle() to randomize the order of the array, and reset() to pluck off the first element of that array. Lastly, you would call explode() to split the username and password. Cheers
  2. Hello g_p_java You are 3 revisions shy of having a new enough version of PHP. I would definitely upgrade, to a newer version of PHP 5.2.x (I think it's 5.2.14 now) I doubt any code will break by doing this, so it should be pretty easy for ya. Cheers
  3. the way I'd do it, I'd put a class on tbodies that should be collapsible. then, inside your for loop, check if the tbody has the class using locl.className If you have multiple classes on the tbody, it gets more complex, but that's the way I'd do it
  4. http://www.steelbreeze.us/play_ground/isfocused.html I made an example script that displays the text box that has focus when any of the three text boxes are clicked. The key is: document.activeElement which shows what element is currently focused. Works in FF 3, IE 7/8 (haven't tested any others...) It's part of HTML 5, so IE 6 prolly doesn't like this.
  5. The best way to handle doing one thing to lots of elements is to use a class. <img class="hiddenIMG"> Then, when you want to show that class, remove the class from the img (or the div if you chose to hide the div containing the img instead)
  6. Instead of using .src, have you tried using .getAttribute('src') ?
  7. typically, I'd attached a class to the tbodies that hides them so, the class is already on the tbodies and they are already hidden. no js required for that then when you go to expand, just remove the css class
  8. try adding an onclick="" to your button <button name="aButton" type="submit" id="aButton" value="false" onclick="clicked()">Edit</button> Hope that helps...
  9. That was my point. Thus your original question and first script example wouldn't do what you want. Even if you appended the element to the script element, it's EXACTLY THE SAME as calling document.write at that point. Hope that makes sense. You're appending to what's there in the body at the point the script is run. if you have <body> <div> <script> .... code here </script> document.write only sees what's on the page, there is no </div> tag yet, and neither would document.body.apendChild So, inserting after the script tag is no different than either of those two. Hope that makes it clearer...
  10. I tried to dig into the page with FireBug to see what's happening there and the page is so big it's not possible to view with FireBug on my computer. This leads me to surmise that your page is simply too big. Browsers do have limits to the size of a page that they can/will display. You've probably run into Firefox's default page size limit. Try reducing the size of the page. That is one humongous page. Who needs all of that on one page anyways?
  11. I don't know why IE is choking on it, but only IE has ActiveX. So, it's pointless to target other browsers with ActiveX...
  12. You can parse the URI and extract the file name of the page you're on. Match that up to a list of pages, and bam. For instance, document.url for this page here holds the value of: "http://www.phpfreaks.com/forums/index.php?action=post;topic=246347.0;num_replies=0"
  13. It looks like you're passing a number to FieldID1. thisField --- That var would be an anchor element thisField[xxxxx] where xxxx is whatever number is contained in FieldID1 would not be pointing to an element, and thus, it has not innerHTML property Hope that helps...
  14. jQuery has a lot of Menu plugins for it: http://plugins.jquery.com/project/Plugins/category/44 this site here -> http://www.cssplay.co.uk/menus/ has a ton of menus (they require standards mode for the most part, whereas the jQuery menus should be fine in quirks mode) Hope that helps...
  15. my understanding is that, if the body tag has already been parsed by the browser, then document.write would be the essentially the same as using document.body.appendChild() So, if you used this in between a tr and a td tag (i.e., not inside the table cell, but sorta in table oblivion), the paragraph would be placed above the table. Hope that helps...
  16. The Zend Framework has published a pretty robust set of coding conventions. I'm sure you'll find some good stuff there. http://framework.zend.com/manual/en/coding-standard.coding-style.html#coding-standards.inline-documentation Hope that helps...
  17. var someElement = document.getElementById('id_to_look_for'); if (someElement) { alert('element found'); } else { alert('element not found'); } Yes, that isn't a mooway to do it, but it's basic javascript. I'm sure the mootools docs have their own method of doing this documented, if they have implemented something for this. I'm not a mooguy, so I couldn't tell ya. Hope that helps...
  18. How does your template decide what to output? From the looks of your code, the crux of the problem lies in the template itself.
  19. setInterval('code to eval....', milliseconds); That function works like eval, executing the string as if it were js. And the milliseconds is the delay time between intervals. Once you set that, it will keep on running. To cancel it, you'd have to store the returned value from setInterval in a variable and call clearInterval var timer = setInterval('code to eval....', milliseconds); clearInterval(timer); Hope that helps...
  20. Expanding on fry2010's post, you might try this: Supposing your ordered list has a div that wraps it with a class of myOrderedList... .myOrderedList { float: left; width: 500px; } .myOrderedList ol{ float: left; } .myOrderedList li{ float: left; width: 100px; } .myOrderedList input{ width: 100px; } What I'm doing there is floating everything (but the input) to the left since that sort of attaches it all together and any border or bg you might put on that div wrapper will fit nicely, instead of sliding up under the ordered list. The div has a width of 500px which can fit 5 input's/li's. If you add any padding/margin/border to either the ol/li/input, you'll have to increase the 500px width on the div wrapper.
  21. By the way, it's recommend that you always enclose IF blocks in curlies --- { and } There are documented cases where javascript gets confused when there aren't { and } because of two possible syntactically correct interpretations.
  22. Just to add to wildteen98, $shoulder_array[0] hasn't been initialized as an array. Put this first: $shoulder_array = array(); And then doing $shoulder_array[0] = ......... will be better. <?php $shoulder_array = array(); $shoulder_array[0] = '<"http://www.muscleandstrength.com/exercises/military-press.html">"Military press"</a>';
  23. My testing indicates that the AREA elements don't exactly live over the image map. And thus image map elements are very specially handled. A solution: make three images. One in a normal state. Second in a hovered state for one part. Third for the other hovered state. You can make this a sprite image, or just have three seperate images. If you use seperate images, then when one area is hovered over (js will respond to hover events on area tags properly), swap out the img src to suit. If you use one sprite bg image, then you'd simply slide that bg image when an area tag is hovered over. I haven't been able to think of any other ways to get image maps to highlight their affected regions because areas don't exactly occupy a physical region even though they cause events to fire in those regions.
  24. You might not have liked my suggestion, but a css framework would do that for you. Of course I'm not forcing you to use one, but you didn't say "I'm not willing to use or consider using a css framework" and hence it was a relevant answer.
  25. Considering that it's an image element, it probably should be conditionally placed on the page depending on what page is loaded. You could put a class on that to hide the image on other pages, but it doesn't make sense to me to send out markup and then hide it in this case.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.