Flash Website Builder- Trendy Site Builder is a Flash Site Building tool that helps users build stunning websites. Check Out Custom Custom Logo Design by LogoBee. Website Design and Free Logo Templates available.
 CodingForums.com Problem in Multiple onkey event

Before you post, read our: Rules & Posting Guidelines

Enjoy an ad free experience by logging in. Not a member yet? Register.
 05-28-2012, 10:31 AM PM User | #1 newphpcoder Regular Coder   Join Date: Aug 2010 Posts: 709 Thanks: 165 Thanked 0 Times in 0 Posts Problem in Multiple onkey event Hi... I just want to know how can I compute the Total Maximum Dozen while I'm input number in the textboxes from Maximum Lot. Now, in my code: When I input in textbox from Maximum lot it computes the Maximum Dozen and Total Maximum Lot, and the Total Maximum Dozen was only compute or change when I press the key on the textbox from Maximum Dozen. I want to happen is:when I input in Maximum Lot textboxes the total Maximum Lot, Maximum Dozen, and Total Maximum Dozen will compute. Here is my code: PHP Code: ``` Half Shell   //auto compute Total  Max function autocalearn(oText) {   var P28_max_lot = document.getElementById("P28_max_lot").value;     var P28_bch_wt = document.getElementById("P28_bch_wt").value;     var P28_plug_wt = document.getElementById("P28_plug_wt").value;     var P28_max_convert = (parseFloat(P28_max_lot) * ((parseFloat(P28_bch_wt))* parseFloat(1000)) / parseFloat(P28_plug_wt) / parseFloat(12));          if( !isNaN(P28_max_convert) ){        var P28_max_doz = document.getElementById("P28_max_doz").value = P28_max_convert.toFixed(2);     }          var P30_max_lot = document.getElementById("P30_max_lot").value;     var P30_bch_wt = document.getElementById("P30_bch_wt").value;     var P30_plug_wt = document.getElementById("P30_plug_wt").value;     var P30_max_convert = (parseFloat(P30_max_lot) * ((parseFloat(P30_bch_wt))* parseFloat(1000)) / parseFloat(P30_plug_wt) / parseFloat(12));      if( !isNaN(P30_max_convert) ){        var P30_max_doz = document.getElementById("P30_max_doz").value = P30_max_convert.toFixed(2);     }          var P32_max_lot = document.getElementById("P32_max_lot").value;     var P32_bch_wt = document.getElementById("P32_bch_wt").value;     var P32_plug_wt = document.getElementById("P32_plug_wt").value;     var P32_max_convert = (parseFloat(P32_max_lot) * ((parseFloat(P32_bch_wt))* parseFloat(1000)) / parseFloat(P32_plug_wt) / parseFloat(12));      if( !isNaN(P32_max_convert) ){     var P32_max_doz = document.getElementById("P32_max_doz").value = P32_max_convert.toFixed(2);     }              var P33_max_lot = document.getElementById("P33_max_lot").value;     var P33_bch_wt = document.getElementById("P33_bch_wt").value;     var P33_plug_wt = document.getElementById("P33_plug_wt").value;     var P33_max_convert = (parseFloat(P33_max_lot) * ((parseFloat(P33_bch_wt))* parseFloat(1000)) / parseFloat(P33_plug_wt) / parseFloat(12));       if( !isNaN(P33_max_convert) ){     var P33_max_doz = document.getElementById("P33_max_doz").value = P33_max_convert.toFixed(2);     }          var P35_max_lot = document.getElementById("P35_max_lot").value;     var P35_bch_wt = document.getElementById("P35_bch_wt").value;     var P35_plug_wt = document.getElementById("P35_plug_wt").value;     var P35_max_convert = (parseFloat(P35_max_lot) * ((parseFloat(P35_bch_wt))* parseFloat(1000)) / parseFloat(P35_plug_wt) / parseFloat(12));           if( !isNaN(P35_max_convert) ){     var P35_max_doz = document.getElementById("P35_max_doz").value = P35_max_convert.toFixed(2);     }          var P35M_max_lot = document.getElementById("P35M_max_lot").value;      var P35M_bch_wt = document.getElementById("P35M_bch_wt").value;     var P35M_plug_wt = document.getElementById("P35M_plug_wt").value;     var P35M_max_convert = (parseFloat(P35M_max_lot) * ((parseFloat(P35M_bch_wt))* parseFloat(1000)) / parseFloat(P35M_plug_wt) / parseFloat(12));      if( !isNaN(P35M_max_convert) ){     var P35M_max_doz = document.getElementById("P35M_max_doz").value = P35M_max_convert.toFixed(2);     }          var P35W_max_lot = document.getElementById("P35W_max_lot").value;       var P35W_bch_wt = document.getElementById("P35W_bch_wt").value;     var P35W_plug_wt = document.getElementById("P35W_plug_wt").value;     var P35W_max_convert = (parseFloat(P35W_max_lot) * ((parseFloat(P35W_bch_wt))* parseFloat(1000)) / parseFloat(P35W_plug_wt) / parseFloat(12));     if( !isNaN(P35W_max_convert) ){     var P35W_max_doz = document.getElementById("P35W_max_doz").value = P35W_max_convert.toFixed(2);     }          var P38_max_lot = document.getElementById("P38_max_lot").value;     var P38_bch_wt = document.getElementById("P38_bch_wt").value;     var P38_plug_wt = document.getElementById("P38_plug_wt").value;     var P38_max_convert = (parseFloat(P38_max_lot) * ((parseFloat(P38_bch_wt))* parseFloat(1000)) / parseFloat(P38_plug_wt) / parseFloat(12));     if( !isNaN(P38_max_convert) ){     var P38_max_doz = document.getElementById("P38_max_doz").value = P38_max_convert.toFixed(2);     }          if (isNaN(oText.value))  { alert('Numbers only!'); oText.value = ''; } var field, val, oForm = oText.form, Total_max_lot = a = 0; for (a; a < arguments.length; ++a) //loop through text elements { field = arguments[a]; val = parseFloat(field.value);  if (!isNaN(val)) //number? { Total_max_lot += val;  } }                                                                                  oForm.Total_max_lot.value = Total_max_lot.toFixed(2);    }         //Auto convert to Doz and auto compute total max doz function doz(oText){   if (isNaN(oText.value))  { oText.value = ''; }  var field, val, oForm = oText.form, Total_max_doz = a = 0; for (a; a < arguments.length; ++a) //loop through text elements { field = arguments[a]; val = parseFloat(field.value);      if (!isNaN(val)) //number? { Total_max_doz += val;  } } oForm.Total_max_doz.value = Total_max_doz.toFixed(2); }
Compounds Max UoM Max UoM
" onkeyup="return autocalearn(this, P30_max_lot, P32_max_lot, P33_max_lot, P35_max_lot, P35M_max_lot, P35W_max_lot, P38_max_lot, P40_max_lot, P41_max_lot, P42_max_lot, P43_max_lot, P46_max_lot, P47_max_lot)" > " onkeyup="return doz(P28_max_doz, P30_max_doz, P32_max_doz, P33_max_doz, P35_max_doz, P35M_max_doz, P35W_max_doz, P38_max_doz, P40_max_doz, P41_max_doz, P42_max_doz, P43_max_doz, P46_max_doz, P47_max_doz)" >
" onkeyup="return autocalearn(this, P28_max_lot, P32_max_lot, P33_max_lot, P35_max_lot, P35M_max_lot, P35W_max_lot, P38_max_lot, P40_max_lot, P41_max_lot, P42_max_lot, P43_max_lot, P46_max_lot, P47_max_lot)" > " onkeyup="return doz(this, P28_max_doz, P32_max_doz, P33_max_doz, P35_max_doz, P35M_max_doz, P35W_max_doz, P38_max_doz, P40_max_doz, P41_max_doz, P42_max_doz, P43_max_doz, P46_max_doz, P47_max_doz)">
" onkeyup="return autocalearn(this, P28_max_lot, P30_max_lot, P33_max_lot, P35_max_lot, P35M_max_lot, P35W_max_lot, P38_max_lot, P40_max_lot, P41_max_lot, P42_max_lot, P43_max_lot, P46_max_lot, P47_max_lot)" > " onkeyup="return doz(this, P28_max_doz, P30_max_doz, P33_max_doz, P35_max_doz, P35M_max_doz, P35W_max_doz, P38_max_doz, P40_max_doz, P41_max_doz, P42_max_doz, P43_max_doz, P46_max_doz, P47_max_doz)">
"  onkeyup="return autocalearn(this, P28_max_lot, P30_max_lot, P32_max_lot, P35_max_lot, P35M_max_lot, P35W_max_lot, P38_max_lot, P40_max_lot, P41_max_lot, P42_max_lot, P43_max_lot, P46_max_lot, P47_max_lot)" > " onkeyup="return doz(this, P28_max_doz, P30_max_doz, P32_max_doz, P35_max_doz, P35M_max_doz, P35W_max_doz, P38_max_doz, P40_max_doz, P41_max_doz, P42_max_doz, P43_max_doz, P46_max_doz, P47_max_doz)">
"  onkeyup="return autocalearn(this, P28_max_lot, P30_max_lot, P32_max_lot, P33_max_lot, P35M_max_lot, P35W_max_lot, P38_max_lot, P40_max_lot, P41_max_lot, P42_max_lot, P43_max_lot, P46_max_lot, P47_max_lot)" > "  onkeyup="return doz(this, P28_max_doz, P30_max_doz, P32_max_doz, P33_max_doz,P35M_max_doz, P35W_max_doz, P38_max_doz, P40_max_doz, P41_max_doz, P42_max_doz, P43_max_doz, P46_max_doz, P47_max_doz)">
"  onkeyup="return autocalearn(this, P28_max_lot, P30_max_lot, P32_max_lot, P33_max_lot, P35_max_lot, P35W_max_lot, P38_max_lot, P40_max_lot, P41_max_lot, P42_max_lot, P43_max_lot, P46_max_lot, P47_max_lot)" > "  onkeyup="return doz(this, P28_max_doz, P30_max_doz, P32_max_doz, P33_max_doz,P35_max_doz, P35W_max_doz, P38_max_doz, P40_max_doz, P41_max_doz, P42_max_doz, P43_max_doz, P46_max_doz, P47_max_doz)">
"  onkeyup="return autocalearn(this, P28_max_lot, P30_max_lot, P32_max_lot, P33_max_lot, P35_max_lot, P35M_max_lot, P38_max_lot, P40_max_lot, P41_max_lot, P42_max_lot, P43_max_lot, P46_max_lot, P47_max_lot)" > "  onkeyup="return doz(this, P28_max_doz, P30_max_doz, P32_max_doz, P33_max_doz,P35_max_doz, P35M_max_doz, P38_max_doz, P40_max_doz, P41_max_doz, P42_max_doz, P43_max_doz, P46_max_doz, P47_max_doz)">
" size="8" onkeyup="return autocalearn(this, P28_max_lot, P30_max_lot, P32_max_lot, P33_max_lot, P35_max_lot, P35M_max_lot, P35W_max_lot, P40_max_lot, P41_max_lot, P42_max_lot, P43_max_lot, P46_max_lot, P47_max_lot)" > " onkeyup="return doz(this, P28_max_doz, P30_max_doz, P32_max_doz, P33_max_doz,P35_max_doz, P35M_max_doz, P35W_max_doz, P40_max_doz, P41_max_doz, P42_max_doz, P43_max_doz, P46_max_doz, P47_max_doz)">
" > ">
``` Can you do me additional favor?If you have time kindly visit this site:http://www.topmovietrailers2012.blogspot.com/ Thank you so much Attached Thumbnails

 Bookmarks

 Thread Tools Rate This Thread Rate This Thread: 5 : Excellent 4 : Good 3 : Average 2 : Bad 1 : Terrible

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home :: Client side development     JavaScript programming         DOM and JSON scripting         Ajax and Design         JavaScript frameworks         Post a JavaScript     HTML & CSS     XML     Flash & ActionScript         Adobe Flex     Graphics and Multimedia discussions     General web building         Site reviews         Building for mobile devices :: Server side development     Apache configuration     Perl/ CGI     PHP         Post a PHP snippet     MySQL         Other Databases     Ruby & Ruby On Rails     ASP     ASP.NET     Java and JSP     Other server side languages/ issues         ColdFusion         Python :: Computing & Sciences     Computer Programming     Computer/PC discussions     Geek News and Humour Web Projects and Services Marketplace     Web Projects         Small projects (quick fixes and changes)         Medium projects (new script, new features, etc)         Large Projects (new web application, complex features etc)         Unknown sized projects (request quote)         Vacant job positions         Looking for work/ for hire         Project collaboration/ partnership         Paid work offers and requests (Now CLOSED)     Career, job, and business ideas or advice     Domains, Sites, and Designs for sale         Domains for sale         Websites for sale         Design templates and graphics for sale :: Other forums     Member Offers     Forum feedback and announcements

All times are GMT +1. The time now is 10:14 AM.