RE: [WSG] Another Question about JavaScript.
Regardless of the JS, this is a web standards group. This example has no labels on your form inputs. The previous example was using tables for layout. Don't concentrate on a single issue and forget semantic, standards-based markup from the very beginning. Ted *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] ***
Re: [WSG] Another Question about JavaScript.
Try with the following code: script function proc() { var num = document.heartSearch.hsQty.value*8.95; document.hSearchoutput.hsTotal.value = r2(num); addMe(); } function prc2() { var num = document.youKnow.cutSandHours.value*12.17; document.outme.soter.value = r2(num); addMe(); } function addMe(){ var x = document.hSearchoutput.hsTotal.value; var y = document.outme.soter.value; var num = parseFloat(x)+parseFloat(y); document.costAndTtl.TtlCost.value = r2(num); } function r2(n) { ans = n * 1000; ans = Math.round(ans /10) + ; while (ans.length 3) {ans = 0 + ans;} len = ans.length; ans = ans.substring(0,len-2) + . + ans.substring(len-2,len); return ans; } /script Regards, Venkatesan M On Fri, Nov 14, 2008 at 2:42 AM, Brett Patterson [EMAIL PROTECTED] wrote: I hate to ask another question about JavaScript, but I need help with ONE more thing, please? *Using the following JS code in XHTML Transitional:* function proc() { var num = document.heartSearch.hsQty.value*8.95; document.hSearchoutput.hsTotal.value = r2(num); } function prc2() { var num = document.youKnow.cutSandHours.value*12.17; document.outme.soter.value = r2(num); } function r2(n) { ans = n * 1000; ans = Math.round(ans /10) + ; while (ans.length 3) {ans = 0 + ans;} len = ans.length; ans = ans.substring(0,len-2) + . + ans.substring(len-2,len); return ans; } *and the following HTML code in XHTML Transitional:* div id=oklastone form action= name=heartSearch select name=hsQty id=hsQty onchange=proc() option value=00/option option value=33/option /select /form /div div id=otherrecal form action= name=hSearchoutput input type=text name=hsTotal id=hsTotal value=0.00 / /form /div div id=meinga form action= name=youKnow select name=cutSandHours id=cutSandHours onchange=prc2() option value=11/option option value=55/option option value=66/option /select /div div id=noca form action= name=outme input type=text name=soter id=soter value=0.00 / /form /div div id=costana form action= name=costAndTtl input type=text name=TtlCost / /form /div How would I get the last form to show the SUM of both the id=hsTotal and the id=soter text fields? -- Brett P. *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] *** *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] ***
Re: [WSG] Another Question about JavaScript.
if you have javascript related questions/talk, you can try comp.lang.javascript. Here: http://groups.google.com/group/comp.lang.javascript/topics?pli=1 On Fri, Nov 14, 2008 at 8:12 AM, Brett Patterson [EMAIL PROTECTED] wrote: I hate to ask another question about JavaScript, but I need help with ONE more thing, please? Using the following JS code in XHTML Transitional: function proc() { var num = document.heartSearch.hsQty.value*8.95; document.hSearchoutput.hsTotal.value = r2(num); } function prc2() { var num = document.youKnow.cutSandHours.value*12.17; document.outme.soter.value = r2(num); } function r2(n) { ans = n * 1000; ans = Math.round(ans /10) + ; while (ans.length 3) {ans = 0 + ans;} len = ans.length; ans = ans.substring(0,len-2) + . + ans.substring(len-2,len); return ans; } and the following HTML code in XHTML Transitional: div id=oklastone form action= name=heartSearch select name=hsQty id=hsQty onchange=proc() option value=00/option option value=33/option /select /form /div div id=otherrecal form action= name=hSearchoutput input type=text name=hsTotal id=hsTotal value=0.00 / /form /div div id=meinga form action= name=youKnow select name=cutSandHours id=cutSandHours onchange=prc2() option value=11/option option value=55/option option value=66/option /select /div div id=noca form action= name=outme input type=text name=soter id=soter value=0.00 / /form /div div id=costana form action= name=costAndTtl input type=text name=TtlCost / /form /div How would I get the last form to show the SUM of both the id=hsTotal and the id=soter text fields? -- Brett P. *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] *** *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] ***
Re: [WSG] Another Question about JavaScript.
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm try http://www.google.com/search?q=javascript+helpsourceid=navclient-ffie=UTF-8rlz=1B3GGGL_enAU252AU254 the list is Web Standards not a help desk. Brett Patterson wrote: I hate to ask another question about JavaScript, but I need help with ONE more thing, please? *Using the following JS code in XHTML Transitional:* function proc() { var num = document.heartSearch.hsQty.value*8.95; document.hSearchoutput.hsTotal.value = r2(num); } function prc2() { var num = document.youKnow.cutSandHours.value*12.17; document.outme.soter.value = r2(num); } function r2(n) { ans = n * 1000; ans = Math.round(ans /10) + ; while (ans.length 3) {ans = 0 + ans;} len = ans.length; ans = ans.substring(0,len-2) + . + ans.substring(len-2,len); return ans; } *and the following HTML code in XHTML Transitional:* div id=oklastone form action= name=heartSearch select name=hsQty id=hsQty onchange=proc() option value=00/option option value=33/option /select /form /div div id=otherrecal form action= name=hSearchoutput input type=text name=hsTotal id=hsTotal value=0.00 / /form /div div id=meinga form action= name=youKnow select name=cutSandHours id=cutSandHours onchange=prc2() option value=11/option option value=55/option option value=66/option /select /div div id=noca form action= name=outme input type=text name=soter id=soter value=0.00 / /form /div div id=costana form action= name=costAndTtl input type=text name=TtlCost / /form /div How would I get the last form to show the SUM of both the id=hsTotal and the id=soter text fields? -- Brett P. *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] *** *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] ***
Re: [WSG] Another Question about JavaScript.
Hi Brett, you can use the document.forms[form number in sequence] to access the elements in a form *document.forms[0].elements[0].value *For further reference http://javascript.internet.com/forms/format-input.html* *Warm Regards Sajan Franco On Fri, Nov 14, 2008 at 9:02 AM, Luke Hoggett [EMAIL PROTECTED]wrote: List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm try http://www.google.com/search?q=javascript+helpsourceid=navclient-ffie=UTF-8rlz=1B3GGGL_enAU252AU254 the list is Web Standards not a help desk. Brett Patterson wrote: I hate to ask another question about JavaScript, but I need help with ONE more thing, please? *Using the following JS code in XHTML Transitional:* function proc() { var num = document.heartSearch.hsQty.value*8.95; document.hSearchoutput.hsTotal.value = r2(num); } function prc2() { var num = document.youKnow.cutSandHours.value*12.17; document.outme.soter.value = r2(num); } function r2(n) { ans = n * 1000; ans = Math.round(ans /10) + ; while (ans.length 3) {ans = 0 + ans;} len = ans.length; ans = ans.substring(0,len-2) + . + ans.substring(len-2,len); return ans; } *and the following HTML code in XHTML Transitional:* div id=oklastone form action= name=heartSearch select name=hsQty id=hsQty onchange=proc() option value=00/option option value=33/option /select /form /div div id=otherrecal form action= name=hSearchoutput input type=text name=hsTotal id=hsTotal value=0.00 / /form /div div id=meinga form action= name=youKnow select name=cutSandHours id=cutSandHours onchange=prc2() option value=11/option option value=55/option option value=66/option /select /div div id=noca form action= name=outme input type=text name=soter id=soter value=0.00 / /form /div div id=costana form action= name=costAndTtl input type=text name=TtlCost / /form /div How would I get the last form to show the SUM of both the id=hsTotal and the id=soter text fields? -- Brett P. *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] *** *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] *** *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] ***