How to create a java script code for item sale?

Asked By 0 points N/A Posted on -
qa-featured

I want some java script code for stationery item sale and print in automatic calculations for offline use

Please some one may helpfor that ?

SHARE
Best Answer by Leslie Mark
Answered By 0 points N/A #195335

How to create a java script code for item sale?

qa-featured

Ayswaria,

The following code will be effective to calculate automatically when any number will be given into textbox.

<script type="text/javascript">

         function calculateTotal() // a function should be defined

{

                 var totalAmt = document.addem.total.value;

                 totalR = eval(totalAmt – document.addem.tb1.value); // The value will be come from var totalAmt.

                 document.getElementById('update').innerHTML = totalR; // The value will be found from update ID.

         }

</script>

<form name="addem" action="" id="addem" >  

         <span id="update">100</span>

         <p><input type="text" name="tb1" onkeyup="calculateTotal()"/>first textbox</p>

         <input type="hidden" name="total" value="100" />

</form>

This code can be easily modified as required.

Thank You

Shifflet Laurel

Best Answer
Best Answer
Answered By 0 points N/A #195341

How to create a java script code for item sale?

qa-featured

If you’re going to add shopping cart system in your website easily then i think then it should be in JavaScript in PHP.

It will depend on what you want in shopping cart items?

Like product Name, ID, Unit Price, Picture & Customer’s Name, ID, email or account verifications etc.

Or you can just use calculating system in your website.

With basic knowledge on PHP ant HTML you can use them on your website easily.

Before going to start please check my attachments & try to follow them carefully.

Hope this will help you to be successful on this project.

Answered By 10 points N/A #195338

How to create a java script code for item sale?

qa-featured

Hello dear,

First add the this code to the checkbox.

<Input type="checkbox" onclick="SetBilling (this. checked);"/> Same as Shipping

And then,  add the attached JavaScript function at the bottom of the page.

Hope it will work.

Regards
Franke Mary

Related Questions