Click to See Complete Forum and Search --> : Javascript, I give it up, Please help coders


hansm
June 8th, 2005, 07:28 PM
i have a little function

<script language="javascript">
function checkout(amount,method,method_end)
{
document.form_checkout.purchase.value = amount;
document.form_checkout.MVC[campaign_method].value = method;
document.form_checkout.MVC[campaign_method_end].value = method_end;

document.form_checkout.submit();
}

but it doesnt work because
document.form_checkout.MVC[campaign_method].value = method;
document.form_checkout.MVC[campaign_method_end].value = method_end;

i need this, how can i solve this?

hansm
June 8th, 2005, 07:28 PM
it needs to change
<input type="hidden" name="MVC[campaign_method]" value="">
<input type="hidden" name="MVC[campaign_method_end]" value="">

those variables, this is required cant make it somehow else. please help thanks.

Dr. Script
June 8th, 2005, 08:43 PM
document.form_checkout.elements['MVC[campaign_method]'].value = method;
document.form_checkout.elements['MVC[campaign_method_end]'].value = method_end;Ask if you need an explanation ...

Dr. Script