I saw this post over in the getting started forum and it reminded me of something I'd thought of a few times. That it would be helpful if there were a contact method to get in touch with a moderator. I see a lot of posts that are duplicates or that should be moved to a different forum and the only way I know to let someone know is to send them a PM and then I only send them to a couple of people that I know to be moderators.
Other forums have a moderator(s) for each forum that are listed on each forum page, or a moderator contact method somewhere that is easy to see. If this is a software limitation I guess there is nothing to be done, otherwise it might be something to look into as I think it would make things easier. I bet there are a lot of people that, not finding a way to contact someone, don't even bother.
Can anyone see why my reply in this thread: https://forum.jquery.com/topic/making-my-code-more-generic is marked as spam? Is there something in the content or did I click something in error? I don't recall having this problem before.
A nice addtion to the boards here might be a new forum for book and tutorial reviews and announcements. This would be nice in that it would give people a place to go to examine books and get real user opinions before buying them.
For more control, and to avoid getting flooded by publishers and authors, the initial post in each thread could be made by a moderator from their own or a submitted review about a specific book/tutorial and then all the discussion would follow. Another advantage would be potential revenue from people following links and buying the books.
Here is one I cannot seem to figure out. I've got a set of text boxes with the change event bound to a function that will do some validation and add some numbers together. If the user enters something that is not a valid number I want to alert them and then put the focus back on the offending field.
My problem is that the event that I'm capturing is not the actual tab key or mouse click. So even though I set the focus in my event handler, the initial event that started the whole thing still moves the focus to the next field or where ever the mouse was clicked.
I've tried preventDefault, stopPropagation, returning false, and a bunch of other things to no avail. I hope it is something I'm missing or not seeing. If not it seems like my only choice is to capture all the events (key presses, mouse clicks etc. and handle them all which seems rather tedious.
// set change events for computed form fields $('input[name^="cap"]').change(function(event){ if (testFundsFields("cap1") && testFundsFields("cap2") && testFundsFields("cap4")){ var c1 = parseInt($("#cap1").val()); var c2 = parseInt($("#cap2").val()); var c4 = parseInt($("#cap4").val());
$("#cap3").val(c1 + c2); $("#cap5").val(parseInt($("#cap3").val()) + c4); } else { /* right here is where I've tried everything to stop the focus from moving */ }// end if fields have valid values }); });
// make sure passed in field ID has a valid numeric value, set it to 0 (zero) if it is empty function testFundsFields(fieldID){ var retVal = true; var theVal = $("#" + fieldID).val(); if (theVal != "" && isNaN(theVal)) { alert("Please enter values as whole numbers."); $("#" + fieldID).focus(); $("#" + fieldID).val(""); retVal = false; } else if (theVal == "") { $("#" + fieldID).val("0"); }
return retVal; } </script> </head> </head>
<body> field 1: <input class="moneyInp" id="cap1" /> <br/> field 2: <input class="moneyInp" id="cap2" /> <br/> field 3: <input class="moneyInp" id="cap3" readonly /> (=1 + 2) <br/> field 4: <input class="moneyInp" id="cap4" /> <br/> field 5: <input class="moneyInp" id="cap5" readonly /> (=3 + 4) </body> </html>