Form Help - with count values

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
alvaro
Forum Newbie
Posts: 12
Joined: Sun Dec 21, 2008 4:12 pm

Form Help - with count values

Post by alvaro »

Hi there, i am begginer in php and ive try to do this alot times, but never got a good conclusion.
got all values and show the total:

Code: Select all

<td width="24%">DMV FEES  : </td>
          <td width="76%"><input name="dmv" class="input" onfocus="this.className='inputon';" onblur="this.className='input';"  id="dmv" value="<?=$dados[dmv];?>" size="20" maxlength="25" /></td>
        </tr>
        <tr>
          <td colspan="2">&nbsp;</td>
          </tr>
        <tr>
          <td>TAX:</td>
          <td><input name="tax"  class="input" onfocus="this.className='inputon';" onblur="this.className='input';"  id="tax"value="<?=$dados[tax];?>" size="20" maxlength="25" /></td>
        </tr>
        <tr>
          <td colspan="2">&nbsp;</td>
          </tr>
        <tr>
          <td>FEE:</td>
          <td><input name="fee"  class="input" onfocus="this.className='inputon';" onblur="this.className='input';" value="<?=$dados[fee];?>" size="20" maxlength="25" /></td>
        </tr>
        <tr>
          <td colspan="2">&nbsp;</td>
          </tr>
        <tr>
          <td>LIEN:</td>
          <td><input name="lien"  class="input" onfocus="this.className='inputon';" onblur="this.className='input';" value="<?=$dados[lien];?>" size="20" maxlength="25" /></td>
        </tr>
        <tr>
          <td colspan="2">&nbsp;</td>
          </tr>
        <tr>
          <td>REG:</td>
          <td><input name="reg"  class="input" onfocus="this.className='inputon';" onblur="this.className='input';" value="<?=$dados[reg];?>" size="20" maxlength="25" /></td>
        </tr>
        <tr>
          <td colspan="2">&nbsp;</td>
          </tr>
        <tr>
          <td>TOTAL:</td>
          <td>
          <input name="total_reg"  class="input" onfocus="this.className='inputon';" onblur="this.className='input';" value="<?=$dados[total_reg];?>" size="20" maxlength="25" />
          </td>
        </tr>
I need the last field receive the total value of all others fields, like $dmv+$tax+$fee+$lien+$reg=$total_reg;

the information is alredy saved in my database.
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

Re: Form Help - with count values

Post by jaoudestudios »

If it is saved in the database, do you want to do it with php and mysql? or with javascript?
alvaro
Forum Newbie
Posts: 12
Joined: Sun Dec 21, 2008 4:12 pm

Re: Form Help - with count values

Post by alvaro »

This is just one part of my full code - there is a big form with alot information.
If its working with php and mysql will be better, other away i can use java too... if u can help me... will be great.
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

Re: Form Help - with count values

Post by jaoudestudios »

Post your table schema for your code above and we can figure it out.
Post Reply