Check Textboxes For Change In Value From Default Value When Page Loaded
Solution 1:
I'll make a try :
$(function(){
$("[id^='Quantity']").each(function(){
$(this).data('default', $(this).val());
});
$("[name='Proceed_To_Checkout_Form']").submit(function(){
var hasChanged = false;
$("[id^='Quantity']").each(function(){
if($(this).val() != $(this).data('default')){
hasChanged = true;
}
});
if(hasChanged){
$("#btnRecalculate").click();
return false;
}
});
});
Solution 2:
On page load, you could store the current values of the fields (these would be the default values, I assume) into a local js variable - most likely an array, to handle the fact that there might be 1, 2, or 3 values to be stored. Once you have those default values stored, the rest should be relatively easy:
When a button is clicked on Form2, its implementation compares the relevant field's current value to its default value (the one you stored when the page loaded). If they're the same, do your normal processing. If they're different, do the "exception case" processing you need.
Hopefully I understood your question correctly, and this approach gets you on the right track. I'll keep an eye on this thread, if you need me to throw together some code examples/snippets.
Post a Comment for "Check Textboxes For Change In Value From Default Value When Page Loaded"