Jump to content

Won't Load in IE


tobeyt23

Recommended Posts

Why won't this load in IE?

 

<?php
if($_REQUEST['save'])
{
if($_REQUEST['pricename_mapping'])
{
		$fieldcount = count($_REQUEST['pricename_mapping']);
		$fielddata = "";

		for($i=0;$i<fieldcount;$i++)
		{
			if($_REQUEST['pricename_mapping'][$i] != '')
			{
				$fielddata .= "{$_REQUEST['field'][$i]}:{$_REQUEST['pricename_mapping'][$i]},";
			}
		}
}

$fielddata =  substr($fielddata, 0, -1);

if($_REQUEST['hard_adds'])
{
		$hardcount = count($_REQUEST['hard_adds']);
		$hardaddsdata = "";

		for($h=0;$h<$hardcount;$h++)
		{
			if($_REQUEST['hard_adds'][$h] != '')
			{
				$temp ="hard_adds_taxable_".$h;
				$taxable = ($_REQUEST[$temp] == 1 ? "1" : "0");
				$hardaddsdata .= "{$_REQUEST['hard_adds'][$h]}:{$taxable},";
			}
		}
}

$hardaddsdata =  substr($hardaddsdata, 0, -1);
print $hardaddsdata;

if($_REQUEST['soft_adds'])
{
		$softcount = count($_REQUEST['soft_adds']);
		$softaddsdata = "";

		for($s=0;$s<$hardcount;$s++)
		{
			if($_REQUEST['soft_adds'][$s] != '')
			{
				$temp ="soft_adds_taxable_".$s;
				$taxable = ($_REQUEST[$temp] == 1 ? "1" : "0");
				$softaddsdata .= "{$_REQUEST['soft_adds'][$s]}:{$taxable},";
			}
		}
}

$softaddsdata =  substr($softaddsdata, 0, -1);

}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>AutoPencil</title>
<script type="text/javascript">

function setMappingsAddons()
{
	var labels = new Array(
							'retail_price:Retail Price',
							'dms_retail:DMS Retail',
							'savings:Savings',
							'listed_price:Listed Price',
							'selling_price:Selling Price',
							'hard_adds:Hard Adds',
							'soft_adds:Soft Adds',
							'warranty:Warranty',
							'rebate:Rebate',
							'purchase_price:Purchase Price',
							'trade_value:Trade Value',
							'trade_balance:Trade Payoff',
							'trade_acv:Trade ACV',
							'trade_net:Trade Equity',
							'net_purchase_price:Net Purchase',
							'tax_state:State',
							'tax_county:County',
							'tax_city:City',
							'tax_total:Total Tax',
							'doc_fee:Doc Fee',
							'tag_fee:Tag Fee',
							'gov_fee:Gov. Fee',
							'addit_fee:Addit. Fee',
							'net_sales:Total Price',
							'downpayment:Amt. Down',
							'amount_financed:Amt. Financed',
							'retail_cost:Retail Cost',
							'adds_costs:Adds Cost',
							'warranty_cost:Warranty Cost',
							'buy_rate:Buy Rate',
							'gross_front:Front Gross',
							'gross_back:Back Gross',
							'total_sale_price:Total Sale Price',
							'finance_charge:Finance Charge',
							'first_payment:First Payment',
							'term:Term',
							'apr:Apr',
							'payment:Payment',
							'cap_fees:Total Cap Fees',
							'total_cap_cost:Total Cap Cost',
							'cap_reduction:Cap Reduction',
							'net_cap_cost:Net Cap Cost',
							'total_depreciation:Total Depreciation',
							'total_finance_fee:Total Finance Fee',
							'security_deposit:Security Deposit',
							'drive_off:Total Drive Off',
							'delivery_cash:Due on Delivery',
							'residual:Residual',
							'money_factor:Money Factor',
							'depreciation:Depreciation',
							'finance_fee:Lease Fee',
							'pretax_payment:Pre-Tax Payment',
							'payment_tax:Tax');

	var savedLabels = "<?=$fielddata;?>";
	var savedHardadds = "<?=$hardaddsdata;?>";
	var savedSoftadds = "<?=$softaddsdata;?>";

	if(savedLabels.length>0);
	{
		var savedSplit = savedLabels.split(',');
		var splitty = new Array();
		for(var all in savedSplit)
		{
			var tmp = savedSplit[all].split(':');
			splitty.push(tmp);
		}
	}

	if(labels.length>0);
	{
		var split = new Array();
		for(var all in labels)
		{
			var tmp = labels[all].split(':');
			split.push(tmp);
		}
	}

	if(savedHardadds.length>0);
	{
		var hardSplit = savedHardadds.split(',');
		var Hardadds = new Array();
		for(var all in hardSplit)
		{
			var tmp = hardSplit[all].split(':');
			Hardadds.push(tmp);
		}
	}

	if(savedSoftadds.length>0);
	{
		var softSplit = savedSoftadds.split(',');
		var Softadds = new Array();
		for(var all in softSplit)
		{
			var tmp = softSplit[all].split(':');
			Softadds.push(tmp);
		}
	}

	var mappingHTML = '';
	mappingHTML += '\n';
	var $r=1;

	for (var i=0;i<labels.length;i++)
	{
		if($r==1)
			mappingHTML += '\t\t\t\t\t<tr>\n';

		mappingHTML += '\t\t\t\t\t\t<td>'+split[i][1]+'</td>\n';
		mappingHTML += '\t\t\t\t\t\t<input type="hidden" name="field[]" value="'+split[i][0]+'">\n';

		if(splitty.length>0)
		{
			for(var all in splitty)
			{

				if(split[i][0]==splitty[all][0])
				{
					value = splitty[all][1];
					break;
				}
				else
					value = '';
			}

		}

		mappingHTML += '\t\t\t\t\t\t<td><input class="textfield" type="text" name="pricename_mapping[]" value="'+value+'" size="20"></td>\n';

		if($r==2)
		{
			mappingHTML += '\t\t\t\t\t</tr>\n';
			$r=1;
		}
		else
			$r=2;	
	}

	mappingHTML += '\t\t\t\t';
	document.getElementById('field_mapping').innerHTML = mappingHTML;


	var hardHTML = '';
	hardHTML += '\n';
	var $r=1;

	for(var i=0;i<10;i++)
	{	
		if($r==1)
			hardHTML += '\t\t\t\t\t<tr>\n';

		hardHTML += '\t\t\t\t\t\t<td><input class="textfield" type="text" name="hard_adds[]" value="" size="20"></td>\n';
		hardHTML += '\t\t\t\t\t\t<td><input class="textfield noBorder" type="checkbox" name="hard_adds_taxable_'+i+'" value="1"></td>\n';

		if($r==2)
		{
			hardHTML += '\t\t\t\t\t</tr>\n';
			$r=1;
		}
		else
			$r=2;	
	}

	hardHTML += '\t\t\t\t';
	document.getElementById('hardadds').innerHTML = hardHTML;


	var softHTML = '';
	softHTML += '\n';
	var $r=1;

	for(var i=0;i<10;i++)
	{
		if($r==1)
			softHTML += '\t\t\t\t\t<tr>\n';

		softHTML += '\t\t\t\t\t\t<td><input class="textfield" type="text" name="soft_adds[]" value="" size="20"></td>\n';
		softHTML += '\t\t\t\t\t\t<td><input class="textfield noBorder" type="checkbox" name="soft_adds_taxable_'+i+'" value="1"></td>\n';

		if($r==2)
		{
			softHTML += '\t\t\t\t\t</tr>\n';
			$r=1;
		}
		else
			$r=2;
	}

	softHTML += '\t\t\t\t';
	document.getElementById('softadds').innerHTML = softHTML;
}
</script> 
</head>
<body onload="setMappingsAddons()">
<form method="POST">
<h2>Field Name Mapping</h2>
		<hr size="1">
		<table border="0" cellspacing="0" cellpadding="5">
			<thead>
				<tr>
					<th>Default Name</th>
					<th>New Name</th>
					<th>Default Name</th>
					<th>New Name</th>
				</tr>
			</thead>
			<tbody id="field_mapping">
			</tbody>
		</table>
		<h2>Hard and Soft Adds-on</h2>
		<hr size="1">
		<table border="0" cellspacing="0" cellpadding="5">
			<thead>
				<tr>
					<th>Hard Add-ons</th>
					<th>Taxable</th>
					<th>Hard Add-ons</th>
					<th>Taxable</th>
				</tr>
			</thead>
			<tbody id="hardadds">
			</tbody>
		</table>
		<table border="0" cellspacing="0" cellpadding="5">
			<thead>
				<tr>
					<th>Soft Add-ons</th>
					<th>Taxable</th>
					<th>Soft Add-ons</th>
					<th>Taxable</th>
				</tr>
			</thead>
			<tbody id="softadds">
			</tbody>
		</table>
<input type="submit" value="Save" name="save">
</form>
</body>
</html>

Link to comment
Share on other sites

it probably does.. just not when you want it too..

 

i'm assuming that this requires to be loaded BEFORE the whole page body is loaded which is not the way IE uses the

 

onload event.. in FF the onload event fires as soon as the page starts loading.. in IE the onload event fires AFTER the page is COMPLETLEY loaded...

 

this very well maybe your issue.. if not... I duno

 

 

I had a similar issue when trying to make a imgz resize mod for phpbb

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.