So I'm back here again, stuck on another issue. This one has had me stumped for a while now. I think it's caused by a lack of sleep, or at least, that contributes to the reason I can't seem to find the answer...
I have a hidden form on the page that has a hidden field, and a specific value set. The action param is empty, so I'm basically doing the postback to the page itself and right at the top of the page I have this:
Language: PHP
if (isset($_POST[';hiddenfieldname';]) && $_POST[';hiddenfieldname';] == ';specificvalue';) {
//It does something here I don';t want to give away
}
Now anyone who's actually worked on this assignment a bit, should figure out what I'm doing here rather easily. My problem is rather obscure, this works *sometimes*. I have a button that submits the form by doing this (Yes it's in javascript since I'm using images...):
Language: Javascript
function LogOut(formName){
obj = document.getElementById(formName);
if (obj != null)
obj.submit();
}
Now I've checked rechecked and then checked again that I'm not getting any JS errors, so pretty sure this isn't a timing issue in terms of page load. Sometimes it works with the first click, other times it works on the 2 or even 3rd click. When it doesn't work, I can see the postback occuring but it's like the code doesn't fire. I've added an echo and when it doesn't work, the echo isn't displayed either. So not completely sure what to make of it, does anyone have any suggestions?