gah... ok, so I don't understand what you mean by the shorthand statement. Here is what is in my header file for the page:
<script type="text/javascript" src="<?=$env?>js/jquery/js/jquery-1.5.1.min.js"></script>
<script type="text/javascript" src="<?=$env?>js/jquery/development-bundle/ui/jquery.ui.core.js"></script>
<script type="text/javascript">
$({
$('#agree').submit(function()
{
$("#gopay").val("Processing...").attr("disabled",true);
$("#cancel").fadeOut("fast");
}
});
</script>
<script type="text/javascript">
$({
$('#colbill').submit(function()
{
$("#processD").val("Processing...").attr("disabled",true);
$("#cancel").fadeOut("fast");
}
});
</script>
<script type="text/javascript">
function getpromo(subtotal){
var inputString = $('#promo').val();
var tax = $('#oldtax').val();
$('#promo').addClass('load');
$.post("sources/payments/promo.php", {queryString: ""+inputString+""}, function(data)
{
$('#promo').removeClass('load');
if(data != 'Not Found')
{
var pieces = data.split('|');
if(Number(tax) != 0)
{
var oldtotal = Number(subtotal) * ((Number(tax)/100) + 1);
var newtotal = ((1 - (Number(pieces[0])/100)) * (Number(subtotal) * ((Number(tax)/100) + 1)));
var newtax = newtotal * (Number(tax)/100);
}
else
{
var oldtotal = Number(subtotal);
var newtotal = ((1 - (Number(pieces[0])/100)) * (Number(subtotal)));
var newtax = 0;
}
var totaldiff = Math.abs(newtotal - oldtotal);
/********************************************************
* WRITE VALUES TO BEGINNING PART OF THE FORM FOR VIEWING
*********************************************************/
$('#total').attr('readonly', false);
$('#total').val(newtotal.toFixed(2));
$('#total').attr('readonly', true);
$('#newtax').attr('readonly', false);
$('#newtax').val(newtax.toFixed(2));
$('#newtax').attr('readonly', true);
$('#discshow').html('('+totaldiff+') or '+pieces[1]+'%');
/********************************************************
* WRITE VALUES TO LATER PART OF THE FORM FOR SUBMISSION
*********************************************************/
$('#promocode').val(inputString);
$('#calctotal').val(newtotal.toFixed(2));
$('#taxsaved').val(newtax.toFixed(2));
$('#discstate').val('('+totaldiff+') or '+pieces[1]+'%');
}
else
{
window.alert('That Promo Code has already been used or is not valid.')
}
});
}
</script>
This is included throughout my checkout process. If I put those 2 new sections for the submit buttons in with the other promo code stuff, the promo code part doesn't work. But I wasn't wrapping it in those additional tags you said to use either. So I put them in their own script tags.
I liked Micah's version better because I do actually want to disable the button so they can't click it again.
But using the above, it's not actually changing the buttons.