Heaven's Martini -thanks - one more question

Results 1 to 2 of 2

Thread: Heaven's Martini -thanks - one more question

  1. #1
    RMZ Guest

    Default Heaven's Martini -thanks - one more question

    I received your response on validating numeric values and it works great. Thanks, I just have one more question. I seem to be having trouble adding all my inpuit boxes together. I currenly have a java script to add the input fields.<BR><BR>Below is a copy of my code. I had to subtract the value to zero inorder for it to recognize it as a number and now it doesn&#039;t work if my value has a comma in it. <BR><BR>What can I do to get around this issue?<BR><BR>Thanks in advance.<BR><BR><BR>function CalcResults() {<BR> //Subtracting 0 from the value converts the string value to a numeric value<BR> var nTotal = (document.frmCalc.txtFuneral.value-0)+ (document.frmCalc.txtMortgage.value-0)<BR> +(document.frmCalc.txtLoans.value-0)+ (document.frmCalc.txtEduc.value-0)<BR> +(document.frmCalc.txtSpouse.value-0) + (document.frmCalc.txtKids.value-0)<BR> + (document.frmCalc.txtTaxes.value-0) + (document.frmCalc.txtOther.value-0);<BR> document.frmCalc.txtTotal.value = nTotal;

  2. #2
    Heaven's Martini Guest

    Default From the DMZ

    Well,<BR><BR>Note the note i had below about numbers and commas.<BR><BR>I would do a replace on your numeric values of the comma (put the field value in a variable and replace that)<BR>you will have to take out the commas before inserting into an int field in Sql server (i would imagine every dbase)<BR><BR>when you put the value back into the textbox use the formatnumber func, one of its options is grouping (the comma)<BR><BR>*personally, i wouldn&#039;t allow the comma. <BR> good luck<BR><BR>www.irt.org should have something on replacing in javascript.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts