-
Posts
3,671 -
Joined
-
Last visited
-
Days Won
17
Content Type
Profiles
Forums
Events
Everything posted by niche
-
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?
-
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?
-
Carlos, have you checked for data in your sql resource?
-
You said in post 3 that you can get the clause to work. How do you know that?
-
Are you using mysql and running it in php (this is a php forum)?
-
Please post your complete mysql_query and the specific errors it produces.
-
Per usual, the best help for coders is found here. Thanks dsonesuk!
-
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.
-
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?
-
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?
-
Ingolme and justsomeguy, Viola! Birbal, thanks for the ref, but I'm not sure how event.preventDefault() should be used in this case?
-
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?
-
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?
-
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;">';
-
How do you code that test?
-
That's good news. I'm just trying to keep the self-inflicted wounds down to a dull roar. Thanks Ingolme and CodeName.
-
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?
-
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>
-
Confirmation on "this" SOLVED with thanks in the last post
niche replied to niche's topic in JavaScript
I understand. Thanks to CodeName and Dsonesuk. -
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>
-
I knew you'd have the back story! Thanks again Ingolme.
-
Thanks Ingolme. What do you think about htmlentities()?
-
How do you display html as code in a browser?
-
Sometimes what we want is not what we need.