Jump to content

niche

Members
  • Posts

    3,671
  • Joined

  • Last visited

  • Days Won

    17

Everything posted by niche

  1. No, but I will later next week I'll have this site up for more testing. This will easily wait til then. Just to confirm, the "go back one page" on the browser re-loads a page out of cache. Right?
  2. All my pages have a back button, but sometimes I accidently click the "go back one page" button on the browser. This can ruin the accurate display of info. A quick page refresh and everything's OK. However, I can spend a few moments wondering what I'm looking at and I'm the one that wrote the page! Is there a name for this situation and what can be done, if anything, when a user doesn't use the back button on the site? A forced refresh might be a solution, but is that even possible?
  3. Carlos, have you checked for data in your sql resource?
  4. You said in post 3 that you can get the clause to work. How do you know that?
  5. Are you using mysql and running it in php (this is a php forum)?
  6. Please post your complete mysql_query and the specific errors it produces.
  7. Per usual, the best help for coders is found here. Thanks dsonesuk!
  8. Thanks for your last posts birbal and justsomeguy. I never heard of bubbling before or experienced it until now. onsubmit = "addBop(); event.stopPropogation();event.preventDefault(); produced bubbling (JS executed & form submited with JS enabled) and... onsubmit = "addBop(); event.preventDefault();event.stopPropogation(); " Only allowed the JS to execute. I reduced by two the things I didn't know, that I didn't know in this topic. Thanks again for everyone's help.
  9. I understand. I just tried this again... onsubmit = "addBop(); event.preventDefault();" ...and it worked this time. I was dragging this topic out because I was under a false impression. I must have misused event.preventDefault(); originally.Just to be clear. onsubmit = "addBop(); event.preventDefault();" Is the alternative to: onsubmit = "addBop(); return false;" Correct?
  10. OK, but how's it used? The examples, in birbal's ref, showed it in a function, but that won't do when JS is disabled. There has to be a way to use event.preventDefault() in the tag for it to be useful with the JS disabled. Right? If so, how can it be used in this case?
  11. Ingolme and justsomeguy, Viola! Birbal, thanks for the ref, but I'm not sure how event.preventDefault() should be used in this case?
  12. I've moved my onsubmit from my form tag to my button tag: echo '<button class="button3" type="submit" style="background:gold;" onsubmit = "addBop().disabled = 1;" >Delete from BOP Cart</button>'; In post 6, birbal suggests that I need to use jQuery, but I don't know it. Isn't there a way to do this with JS? If so, I'm not able to find it. What should I be looking at?
  13. I added "onsubmit" to my form tag and left JS enabled... echo '<form action="cart.php" method="post" style="float:left;" onsubmit = "addBop()">'; ... and the form executed the php instead of this JS function: function addBop() { alert("Here");} Shouldn't this function have executed instead?
  14. I was in the middle of asking for more help when it occurred to me that simply adding a onsubmit for a fictitious function would simulate a user with Javascript is disabled. Right? echo '<form onsubmit = "addBop()" action="cart.php" method="post" style="float:left;">';
  15. Is it safer to send data, that starts as a value in an element, through a form submission, or an AJAX call, or does it matter if it's validated in both cases? By safer, I mean subject to hacking/re-writing? I've been told that it's easy to hack/re-write a value with firebug.
  16. That's good news. I'm just trying to keep the self-inflicted wounds down to a dull roar. Thanks Ingolme and CodeName.
  17. In this case, el.innerHTML = does the same thing as document.getElementById('button2').innerHTML =. Is that a fact or does it just seem that way? EDIT: What are the best practices issues if any?
  18. This just soaked in. I suppose it can be called targeting by variable. What are the pros/cons of targeting by id vs variable where targeting by variable is defined as: <head><script type="text/javascript">function display(el) { if (el.innerHTML == 'Send BOP to Cart') { el.innerHTML = 'Sent BOP to Cart'; } else { el.innerHTML = 'Send BOP to Cart'; } //var test = el.innerHTML; //alert(test);}</script><style type="text/css">#button2 {padding:0px;width:82px;height:40px;vertical-align:top;}</style></head><body><button id="button2" onclick="display(this)">Send BOP to Cart</button></body></html>
  19. I understand. Thanks to CodeName and Dsonesuk.
  20. This script produces an alert that says: [object HTMLButtonElement]. Is that saying I have access access to the button element as an array? <head><script type="text/javascript">function display(el) { alert(el);}</script></head><body><button name="jasmine" type="button" onclick="display(this)">Send</button></body></html>
  21. I knew you'd have the back story! Thanks again Ingolme.
  22. Thanks Ingolme. What do you think about htmlentities()?
  23. Sometimes what we want is not what we need.
×
×
  • Create New...