Jump to content


  • Posts

  • Joined

  • Last visited

About squigs

  • Birthday 03/23/1984

Profile Information

  • Gender
  • Location

squigs's Achievements


Member (2/5)



  1. Hello, I am building a navigation bar with sub menus which appear when the main item is clicked and disappear when the user clicks elsewhere. I have read numerous posts concerning this topic but I'm not sure how to implement it. My code is as follows: topNav.js <script> var timeout = 50; var closetimer = 0; var ddmenuitem = 0; // open hidden layer function mopen(id) { // cancel close timer mcancelclosetime(); // get new layer and show it ddmenuitem = document.getElementById(id); ddmenuitem.style.visibility = 'visible'; } // close showed layer function mclose() { if (ddmenuitem) ddmenuitem.style.visibility = 'hidden'; } // go close timer function mclosetime() { closetimer = window.setTimeout(mclose, timeout); } // cancel close timer function mcancelclosetime() { if (closetimer) { window.clearTimeout(closetimer); closetimer = null; } } // need to somehow close layer when click-out </script> Html <body> <div id="main_nav"> <ul id="nav"> <li class="nav"><a href="#" onclick="mopen('m1')"> <span class="nav_parent">CONTACT US</span></a> <div id="m1"> <a href="#">General Inquiries</a> <a href="#">Request a Quote</a> <a href="#">Submit Plans</a> <a href="#">Submit Photos</a> </div></li> </ul> </div> </body> An example of this is at http://jsfiddle.net/schwiegler/t859A/21/
  2. And I'm still trying to pass grade eight
  3. Typically if you do as DavidAM has suggested and create your form so it is working without client side validation and then add your javascript for client side validation afterwards what will happen if you write your validation code correctly is that the server side validation will not ever occur. Essentially is a user leaves a field blank and you have written form validation that does not allow that, the process will never be carried out in the server side thus the error will not be repeated. You will notice if your javascript is not written correctly you will end up for example seeing a javascript alert followed by your server side error message as well. In otherwords if you are doing it right the front end validation will stop the back end from happening. I hope that explains it a bit better otherwise you may have to be a bit more detailed in your question.
  4. Not to mention think of all the people who use phones. The phone are smart but people aren't. Think of all of the posts you've seen on php freaks forums of people who say "it's broken" (hopefully I'm not the worst offender) but with no idea of what they are actually doing. Now picture those same people in the cell phone stores with the phone they had root access to extended in their hands "it's broken..." It is the whole idea of companies trying to make the one-phone-fits-all solution and unfortunately that usually means dumbing it down. I do feel that they shouldn't go to great lengths such as apple to prevent people who want raw access to the phone's capabilities.
  5. I used to be a bit paranoid about it. Now I just wish I owned their market shares.
  6. I guess there's a little bit of that in everything these days. Well everything you have to purchase anyways. It's understandable why it's done (profit) but you need the hindsight to see the limitations and downfalls sometimes as well as the potential for new ideas. Everyone wants to be a giant and whoever can set the initial tone to steer the market in that direction can only be on top for so long before others adapt new ideas from what's been developed. If they were out to please everyone they would have to be open sourced and that means free.
  7. That's why I give the nod to their terms and when they turn their backs...
  8. Hipster... I am so not a hipster. Don't even get me started on hipsters. Jokes.. I use an iphone (although its an old 3g) I'm just proud that I haven't lost/broken it in 3 years...
  9. Thanks for the input! 9% is still a large number of people using ie7 although I have to wonder, if a user is using an out of date browser how likely is it that they would be shopping for goods/services online vs. checking emails and updating themselves on daily news etc. I can't help but think it could be an older population that is stuck on older browsers as they are less tech savvy and less likely to want the latest/greatest. Of course that is just a generalization but if it were to bear any truth to it the methods used to design a website relies heavily on the audience you are targeting. I wonder what the web analytics would look like for a site like php freaks.
  10. I don't claim to be a professional by any stretch, my target audience generally would be a local one. From what I see looking at the stats only about 0.6% of Canadians still use ie6 so that's one I would ignore completely. (My current site looks like shit on it anyways) But I may have to look deeper into fixing things up for ie7 because it renders much in the same way as 6 did.
  11. So here we are entering the latter part of 2012, HTML5 is on the rise and the most popular browser creators have given their heads a shake and are now coming together to (more or less) standardize HTML/CSS to the relief of web designers and programmers. With that said, we are still in the midst of the transition period so I would like to poll the community and ask which browsers across which platforms should web designers be targeting to achieve proper displays and functions? The question arose for me after I decided it was time to do a broader test on my own current site. I typically have the latest of the big three installed for local testing purposes, those being Firefox, Chrome and IE. I also have Safari installed and check on the ipad and iphone from time to time. I figured I would take it a step further and google cross browser testing and came up with a couple free solutions online. In running these tests I found out a couple of things. There are many more browsers available than I had anticipated and for the most part my site quite consistent across most with a few exceptions. So I'll turn it over to this community to get your thoughts on which browsers are a must for considerations and where to draw the line when looking at backwards compatibility. Cheers
  12. Those are the ones, just thought i'd point it out.
  13. Got it sorted out! I ended up using this to get my desired result. var addFile = document.getElementById('addFile'); addFile.onclick = function addFile() { if (this.count == undefined) { this.count = 0; } if (this.count++ < 4) { $("td.files").append('<tr><td><input type="file" name="uploaded_file[]" class="file_input" size="46" style="margin-top:3px;"/><a class="delete" href="javascript:void(0)" style="color:blue; padding-left:15px;">Remove File</a></td></tr>'); } };
  14. Hope everyone is doing well, I'm trying to append items with javascript but limit the amount of times they can be appended. Currently I am using this to add the items with no limit. $(".add").click(function() { $("td.files").append('<tr><td><input type="file" name="uploaded_file[]" class="file_input" size="46" style="margin-top:3px;"/><a class="delete" href="javascript:void(0)" style="color:blue; padding-left:15px;">Remove File</a></td></tr>'); }); I have been playing with the following but am unable to get it functioning: var count = 0; $(".add").onclick = function(e) { if (count >= 4) { return false; } else { count++; $("td.files").innerHTML += '<tr><td><input type="file" name="uploaded_file[]" class="file_input" size="46" style="margin-top:3px;"/><a class="delete" href="javascript:void(0)" style="color:blue; padding-left:15px;">Remove File</a></td></tr>'; } }; I have also tried assigning IDs instead of classes and using document.getElementById to no avail. am I doing wrong here? Thanks
  • 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.