简体   繁体   中英

How to calculate the cost of an items in the same page?

Iam selecting one product through dropdown and getting the cost.How can i display the cost in another text box with in the same page can any one help me regarding this.

$(function() { var addDiv = $('#brandname'); var i = $('#brandname p').size() + 1; $('#addNew').live('click', function() { $('

Remove

').appendTo(addDiv); i++; return false; }); $('#remNew').live('click', function() { if( i > 1 ) { $(this).parents('p').remove(); i--; } return false; }); }); Brand Name
 <input type="text" name="brand_name" id="brand_name" value="<?php echo 

set_value('brand_name');?>" />Add

  </div> 

This is the code which iam using if i click on plus button it will display another text box for adding the items.

And the total amount should be calculated and should display in same page but in another text box.

you have to use Ajax and Php. please go through this link PHP - AJAX and MySQL

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM