aturner51
Posts: 6
|
| Posted: 05/02/2005, 4:21 PM |
|
I have two fields that display data to the user that is not being sent to a database. The fields are used to display the "Sum_Total" and the "Total_Price" in an editable grid, like the OrderEntry Form used in the CCSExamplePack. When the user clicks the "Submit" button, it takes them to the search page, except the Sum_Total and Total_Price are left blanked when you view the page. The information entered in the master record is left intacted.
How can I get the information to remain in the two fields without losing focus on what was entered when I leave the page and return? (This information is being automatically generated using a javascript placed in the HTML header.)
I maded a duplicate of my original form and renamed it to display the same information using labels, except for the editable grid. I editable grid fields were disabled, which allowed me to input data into a SQL database when the "Submit" button is pressed and not allowing the user to make changes to the grid. The "Add Item" and "Submit" button are not visible when the user is sent to the duplicate page. This allows them to either print a copy of the form, if necessary.
The form is written using CCS 2.3.24, ASP and SQL 2000. I have included a copy of the javascript:
<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 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);
if (store_orders_itemsElements[store_orders_itemsWaivedID].value == "Y" |
store_orders_itemsElements[store_orders_itemsWaivedID].value == "y" ) {
Summ = 0;
}
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>
|
 |
 |
|