CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 Add Checkbox and Textbox to Order Entry Form Example

Print topic Send  topic

Author Message
Alicia
Posted: 04/17/2005, 11:04 AM

I was able to recreate a Receipting Form that was implemented using the Order Entry form found in the CCSExamplePack. I need to also insert a checkbox that will be used if a subject wants to waive a fee, they can check the checkbox that will automatically set the unit price and sumprice to zero. I was able to test it by adding "99" to the total price field, if a check mark was placed in one of the checkbox. However, I'm not sure how to effectively do this to check the unit price and sum price when a selection is made from the drop down listbox, that automatically displays the cost in the unit price. I would like the unit price and sum price to change to 0.00, if later the user decides to waive the unit price. An example of the code in the HTML page is included below:

<html>
<head>
<meta name="GENERATOR" content="CodeCharge Studio 2.3.2.24">
<title>Automated Receipting System - ARS</title>
<script language="JavaScript">
function StrToFloat(str)
{
if (str.indexOf(",") != -1) {
str = str.replace(",",".");
}
var result = parseFloat(str);
if (isNaN(result)) {
result = 0.0;
}
return result;
}


function MyTest()
{
document.store_orders_items.Total_price.value = 99;
}

function Show_Total()
{
var TotalSum=0;
var Summ;
for(var i = 0; i < store_orders_itemsElements.length; i++){
Summ = StrToFloat(store_orders_itemsElements[store_orders_itemspriceID].value) *
StrToFloat(store_orders_itemsElements[store_orders_itemsquantityID].value);
TotalSum = TotalSum + Summ;
if (Summ == 0) {
store_orders_itemsElements[store_orders_itemsSumPriceID].value = "";
} else {
store_orders_itemsElements[store_orders_itemsSumPriceID].value = Math.round(Summ*100)/100;
}
}
document.store_orders_items.Total_price.value = Math.round(TotalSum*100)/100;
}

function disable_record()
{
// document.store_orders_record.user_id.disabled = true;
// document.store_orders_record.order_date.disabled = true;
// document.store_orders_record.Button_Update.disabled = true;
// document.store_orders_record.Button_Delete.disabled = true;

}

function disable_editablegrid()
{
if (document.forms["store_orders_items"]) {
for(var i = 0; i < store_orders_itemsElements.length; i++){
store_orders_itemsElements[store_orders_itemsproduct_idID].disabled = true;
store_orders_itemsElements[store_orders_itemsquantityID].disabled = true;
store_orders_itemsElements[store_orders_itemspriceID].disabled = true;
}
document.store_orders_items.Button_Submit.disabled = true;
}
}


//Begin CCS script
//Include JSFunctions @1-7033547D
</script>
<script language="JavaScript" type="text/javascript" src="functions.js"></script>
<script language="JavaScript" type="text/javascript">

//End Include JSFunctions

//page_store_orders_items_product_id_OnChange @9-4CABBD66
function page_store_orders_items_product_id_OnChange()
{
var result;
//End page_store_orders_items_product_id_OnChange

//Custom Code @10-2A29BDB7

var Element_Number = this.name.substring(11)-1;
var Element_ID = store_orders_itemsElements[Element_Number][store_orders_itemsproduct_idID].value;
if (parseInt(Element_ID) > 0) {
store_orders_itemsElements[Element_Number][store_orders_itemspriceID].value = product_price[parseInt(Element_ID)];
} else {
store_orders_itemsElements[Element_Number][store_orders_itemspriceID].value = 0;
}
Show_Total();
disable_record();

//End Custom Code

The example I have included is called "Mytest", with the field value called "waived". I'm not sure how to change the javascript to automatically set the unit price and sum price to zero. I am using Code Charge Studio with ASP. Can someone assist and showing me the code and were the insertion needs to take place?

Thanks in advance.

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.