D
David Rad
After an exhaustive search on user groups/web I make a humble request
for HELP! The script below is contained in
http://shop.rsci.com/edit5.html. I get errors pointing to line 135 and
186. There are no duplicate functions that I can determine. Can anyone
point me in the right direction? Thanks, David.
<SCRIPT language=javascript><!--
function PlaceInShoppingCart(){
var strUrl, strUrl2, lngAvail, lngOrdered, strMessage, strMessage2,
strMessage3, strReturn, strValue, strType, strWebItemStatus,
strOrderQty;
var blFlag = new Boolean(true);
blFlag = true;
strType = " ";
strValue = "0";
strWebItemStatus = " ";
//alert("WebITemStatus" + strWebItemStatus)
if ( ( strValue == "0" ) || isNaN( strValue ) ) {
strValue = 1;
}
else {
strValue = parseInt( strValue);
}
// COMMENTED OUT THE LOGIC FOR M IMTYPE ITEMS
//if( ( strValue ) > 1 & strType == 'M' ){
// lngAvail = parseFloat(document.frmItemInfo.AvailableUnits.value);
// strOrderQty = parseInt(document.frmItemInfo.Quantity.value);
// leave commented out// alert("strOrderQty=" + strOrderQty)
// leave commented out// alert("lngAvail=" + lngAvail +
"document.frmItemInfo.Quantity.value + lngAvail" +
(parseInt(document.frmItemInfo.Quantity.value) + lngAvail))
// leave commented out// alert("Quantity=" +
document.frmItemInfo.Quantity.value)
// leave commented out// if( ( document.frmItemInfo.Quantity.value %
strValue ) != 0 ){
// leave commented out// if( ( document.frmItemInfo.Quantity.value %
strValue ) != 0 && (parseInt(document.frmItemInfo.Quantity.value)) >
parseInt(lngAvail)) {
// if( ( document.frmItemInfo.Quantity.value % strValue ) != 0 && ((
strOrderQty + lngAvail) % strValue) != 0 &&
(document.frmItemInfo.Quantity.value > lngAvail)) {
// alert("The amount that you have requested is not a multiple of the
Standard Package Quantity");
// blFlag = false;
// }
//}
if ( ( blFlag ) && ( document.frmItemInfo.ItemDesc.value != "Item Not
Found, Did you select the appropriate search?" ) ) {
strUrl = "richmondshoppingcartmiddle.asp";
strUrl2 = "search_results_industrial.asp";
lngAvail = parseFloat(document.frmItemInfo.AvailableUnits.value);
lngOrdered = parseFloat(document.frmItemInfo.Quantity.value);
// alert(lngOrdered > lngAvail);
strReturn = "\r\n";
strMessage = "We currently have a quantity of " + lngAvail + "
available." + strReturn + "Click OK to order your requested quantity."
+ strReturn + "Click Cancel to change your order quantity." +
strReturn;
strMessage2 = "We currently have none available." + strReturn +
"Click OK to Backorder your requested quantity of " + lngOrdered +
"." + strReturn + "Click Cancel to remove this line item from the
order."
strMessage3 = "We currently have a remaining quantity of " + lngAvail
+ " available." + strReturn + "Click OK to order the remaining
quantity." + strReturn + "Click Cancel to change your order quantity."
+ strReturn;
if( lngOrdered > lngAvail && strWebItemStatus == "D") {
if( window.confirm(strMessage3) ){
Quantity = lngAvail
document.forms[0].func.value = "add"
document.frmItemInfo.action = strUrl;
document.frmItemInfo.submit();
}
}
else
//if( lngOrdered > lngAvail ) {
//alert("1")
// if( window.confirm(strMessage) ){
// document.forms[0].func.value = "add"
// document.frmItemInfo.action = strUrl;
// document.frmItemInfo.submit();
//}
//}
//else
{
//alert("2")
document.forms[0].func.value = "add"
document.frmItemInfo.action = strUrl;
document.frmItemInfo.submit();
}
}
}
/*
function PlaceInShoppingCart(){
var strUrl, strUrl2, lngAvail, lngOrdered, strMessage, strMessage2,
strReturn;
strUrl = "richmondshoppingcartmiddle.asp";
strUrl2 = "search_results_industrial.asp";
lngAvail = document.frmItemInfo.AvailableUnits.value;
lngOrdered = document.frmItemInfo.Quantity.value;
strReturn = "\r\n";
strMessage = "We currently have a quantity of " + lngAvail + "
available." + strReturn + "Click OK to order your requested quantity."
+ strReturn + "Click Cancel change your order quantity.";
strMessage2 = "We currently have none available." + strReturn +
"Click OK to Backorder your requested quantity of " + lngOrdered +
"." + strReturn + "Click Cancel to remove this line item from the
order."
if( (!isNaN(document.frmItemInfo.Quantity.value ) ) &&
(document.frmItemInfo.Quantity.value > 0) ){
if ( lngAvail < 1 )
if ( window.confirm(strMessage2) )
{
document.frmItemInfo.Quantity.value = lngOrdered
document.forms[0].func.value = "add"
document.forms[0].action = strUrl;
document.forms[0].submit(); }
else {
//document.frmItemInfo.Quantity.value = 1
//document.forms[0].action = strUrl2;
//document.forms[0].submit()
}
else
if ( ( lngOrdered > lngAvail ) && (
document.frmItemInfo.cbBackOrder.checked) )
{
document.forms[0].func.value = "add"
document.forms[0].action = strUrl;
document.forms[0].submit();
}
else
if ( lngOrdered > lngAvail && ( window.confirm(strMessage) ) )
{
document.frmItemInfo.Quantity.value = lngOrdered
document.forms[0].func.value = "add"
document.forms[0].action = strUrl;
document.forms[0].submit();
}
else
if ( ( lngOrdered <= lngAvail ) )
{
document.forms[0].func.value = "add"
document.forms[0].action = strUrl;
document.forms[0].submit()
}
}
else
alert("The quantity ordered must be a number and greater than 0.")
}
*/
//-->
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
<!--
function GetCheckedValue( strRB ){
var strTemp, i;
i = 0;
while (i < strRB.length ) {
if ( strRB.checked )
strTemp = strRB.value;
i++;
}
return strTemp;
}
function SetDropDownSelected( objddlb, strValue ){
var i;
for( i = 0; i < objddlb.length; i++ ){
if ( objddlb.value == strValue ){
objddlb.selected = true
}
}
}
//-->
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
<!--
function PerformSearch() {
var strQS;
strQS = "rdZS=" + GetCheckedValue(document.forms[0].rdZS);
strQS += "&ZipSearch=" + document.forms[0].ZipSearch.value;
// alert(document.forms[0].cbExactMatch.checked == true);
//if (document.forms[0].cbExactMatch.checked == true){
//alert("checked")
strQS += "&ExactMatch=1"
//}
//else{
//alert("not checked")
// strQS += "&ExactMatch=0"
//}
//alert("richmondSearchIntermediate.asp?" + strQS)
top.location = "ZipSearch_Lookup.asp?" + strQS;
}
function DoNothing() {
}
function selectItems() {
var strQS;
strQS += "&ZipSearch=" + ""
// Do Not use the ZipSearch input box value when searching by Item
Search Word. Set it to BLANKS
//strQS += "&ZipSearch=" + document.forms[0].ZipSearch.value;
//alert(document.forms[0].cbExactMatch.checked == true);
if (document.forms[0].cbExactMatch.checked == true){
//alert("checked")
strQS += "&ExactMatch=1"
}
else{
//alert("not checked")
strQS += "&ExactMatch=0"
}
//alert("richmondSearchIntermediate.asp?" + strQS)
top.location = "ZipSearch_Lookup.asp?" + strQS;
}
// function selectItems() {
// var strQS;
// strQS += "&ZipSearch=" + document.forms[0].ZipSearch.value;
// strQS += "&ZipSearch=" + "#";
// alert(document.forms[0].cbExactMatch.checked == true);
// if (document.forms[0].cbExactMatch.checked == true){
// alert("checked")
// strQS += "&ExactMatch=1"
// }
// else{
// alert("not checked")
// strQS += "&ExactMatch=0";
// }
// alert("BurcoSearchIntermediate.asp?" + strQS)
// top.location = "RichmondZipSearchLookup.asp?" + strQS;
// }
//-->
</SCRIPT>
for HELP! The script below is contained in
http://shop.rsci.com/edit5.html. I get errors pointing to line 135 and
186. There are no duplicate functions that I can determine. Can anyone
point me in the right direction? Thanks, David.
<SCRIPT language=javascript><!--
function PlaceInShoppingCart(){
var strUrl, strUrl2, lngAvail, lngOrdered, strMessage, strMessage2,
strMessage3, strReturn, strValue, strType, strWebItemStatus,
strOrderQty;
var blFlag = new Boolean(true);
blFlag = true;
strType = " ";
strValue = "0";
strWebItemStatus = " ";
//alert("WebITemStatus" + strWebItemStatus)
if ( ( strValue == "0" ) || isNaN( strValue ) ) {
strValue = 1;
}
else {
strValue = parseInt( strValue);
}
// COMMENTED OUT THE LOGIC FOR M IMTYPE ITEMS
//if( ( strValue ) > 1 & strType == 'M' ){
// lngAvail = parseFloat(document.frmItemInfo.AvailableUnits.value);
// strOrderQty = parseInt(document.frmItemInfo.Quantity.value);
// leave commented out// alert("strOrderQty=" + strOrderQty)
// leave commented out// alert("lngAvail=" + lngAvail +
"document.frmItemInfo.Quantity.value + lngAvail" +
(parseInt(document.frmItemInfo.Quantity.value) + lngAvail))
// leave commented out// alert("Quantity=" +
document.frmItemInfo.Quantity.value)
// leave commented out// if( ( document.frmItemInfo.Quantity.value %
strValue ) != 0 ){
// leave commented out// if( ( document.frmItemInfo.Quantity.value %
strValue ) != 0 && (parseInt(document.frmItemInfo.Quantity.value)) >
parseInt(lngAvail)) {
// if( ( document.frmItemInfo.Quantity.value % strValue ) != 0 && ((
strOrderQty + lngAvail) % strValue) != 0 &&
(document.frmItemInfo.Quantity.value > lngAvail)) {
// alert("The amount that you have requested is not a multiple of the
Standard Package Quantity");
// blFlag = false;
// }
//}
if ( ( blFlag ) && ( document.frmItemInfo.ItemDesc.value != "Item Not
Found, Did you select the appropriate search?" ) ) {
strUrl = "richmondshoppingcartmiddle.asp";
strUrl2 = "search_results_industrial.asp";
lngAvail = parseFloat(document.frmItemInfo.AvailableUnits.value);
lngOrdered = parseFloat(document.frmItemInfo.Quantity.value);
// alert(lngOrdered > lngAvail);
strReturn = "\r\n";
strMessage = "We currently have a quantity of " + lngAvail + "
available." + strReturn + "Click OK to order your requested quantity."
+ strReturn + "Click Cancel to change your order quantity." +
strReturn;
strMessage2 = "We currently have none available." + strReturn +
"Click OK to Backorder your requested quantity of " + lngOrdered +
"." + strReturn + "Click Cancel to remove this line item from the
order."
strMessage3 = "We currently have a remaining quantity of " + lngAvail
+ " available." + strReturn + "Click OK to order the remaining
quantity." + strReturn + "Click Cancel to change your order quantity."
+ strReturn;
if( lngOrdered > lngAvail && strWebItemStatus == "D") {
if( window.confirm(strMessage3) ){
Quantity = lngAvail
document.forms[0].func.value = "add"
document.frmItemInfo.action = strUrl;
document.frmItemInfo.submit();
}
}
else
//if( lngOrdered > lngAvail ) {
//alert("1")
// if( window.confirm(strMessage) ){
// document.forms[0].func.value = "add"
// document.frmItemInfo.action = strUrl;
// document.frmItemInfo.submit();
//}
//}
//else
{
//alert("2")
document.forms[0].func.value = "add"
document.frmItemInfo.action = strUrl;
document.frmItemInfo.submit();
}
}
}
/*
function PlaceInShoppingCart(){
var strUrl, strUrl2, lngAvail, lngOrdered, strMessage, strMessage2,
strReturn;
strUrl = "richmondshoppingcartmiddle.asp";
strUrl2 = "search_results_industrial.asp";
lngAvail = document.frmItemInfo.AvailableUnits.value;
lngOrdered = document.frmItemInfo.Quantity.value;
strReturn = "\r\n";
strMessage = "We currently have a quantity of " + lngAvail + "
available." + strReturn + "Click OK to order your requested quantity."
+ strReturn + "Click Cancel change your order quantity.";
strMessage2 = "We currently have none available." + strReturn +
"Click OK to Backorder your requested quantity of " + lngOrdered +
"." + strReturn + "Click Cancel to remove this line item from the
order."
if( (!isNaN(document.frmItemInfo.Quantity.value ) ) &&
(document.frmItemInfo.Quantity.value > 0) ){
if ( lngAvail < 1 )
if ( window.confirm(strMessage2) )
{
document.frmItemInfo.Quantity.value = lngOrdered
document.forms[0].func.value = "add"
document.forms[0].action = strUrl;
document.forms[0].submit(); }
else {
//document.frmItemInfo.Quantity.value = 1
//document.forms[0].action = strUrl2;
//document.forms[0].submit()
}
else
if ( ( lngOrdered > lngAvail ) && (
document.frmItemInfo.cbBackOrder.checked) )
{
document.forms[0].func.value = "add"
document.forms[0].action = strUrl;
document.forms[0].submit();
}
else
if ( lngOrdered > lngAvail && ( window.confirm(strMessage) ) )
{
document.frmItemInfo.Quantity.value = lngOrdered
document.forms[0].func.value = "add"
document.forms[0].action = strUrl;
document.forms[0].submit();
}
else
if ( ( lngOrdered <= lngAvail ) )
{
document.forms[0].func.value = "add"
document.forms[0].action = strUrl;
document.forms[0].submit()
}
}
else
alert("The quantity ordered must be a number and greater than 0.")
}
*/
//-->
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
<!--
function GetCheckedValue( strRB ){
var strTemp, i;
i = 0;
while (i < strRB.length ) {
if ( strRB.checked )
strTemp = strRB.value;
i++;
}
return strTemp;
}
function SetDropDownSelected( objddlb, strValue ){
var i;
for( i = 0; i < objddlb.length; i++ ){
if ( objddlb.value == strValue ){
objddlb.selected = true
}
}
}
//-->
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
<!--
function PerformSearch() {
var strQS;
strQS = "rdZS=" + GetCheckedValue(document.forms[0].rdZS);
strQS += "&ZipSearch=" + document.forms[0].ZipSearch.value;
// alert(document.forms[0].cbExactMatch.checked == true);
//if (document.forms[0].cbExactMatch.checked == true){
//alert("checked")
strQS += "&ExactMatch=1"
//}
//else{
//alert("not checked")
// strQS += "&ExactMatch=0"
//}
//alert("richmondSearchIntermediate.asp?" + strQS)
top.location = "ZipSearch_Lookup.asp?" + strQS;
}
function DoNothing() {
}
function selectItems() {
var strQS;
strQS += "&ZipSearch=" + ""
// Do Not use the ZipSearch input box value when searching by Item
Search Word. Set it to BLANKS
//strQS += "&ZipSearch=" + document.forms[0].ZipSearch.value;
//alert(document.forms[0].cbExactMatch.checked == true);
if (document.forms[0].cbExactMatch.checked == true){
//alert("checked")
strQS += "&ExactMatch=1"
}
else{
//alert("not checked")
strQS += "&ExactMatch=0"
}
//alert("richmondSearchIntermediate.asp?" + strQS)
top.location = "ZipSearch_Lookup.asp?" + strQS;
}
// function selectItems() {
// var strQS;
// strQS += "&ZipSearch=" + document.forms[0].ZipSearch.value;
// strQS += "&ZipSearch=" + "#";
// alert(document.forms[0].cbExactMatch.checked == true);
// if (document.forms[0].cbExactMatch.checked == true){
// alert("checked")
// strQS += "&ExactMatch=1"
// }
// else{
// alert("not checked")
// strQS += "&ExactMatch=0";
// }
// alert("BurcoSearchIntermediate.asp?" + strQS)
// top.location = "RichmondZipSearchLookup.asp?" + strQS;
// }
//-->
</SCRIPT>