If I understand correctly, you're halfway there already:
PHP Code:
function usePage(frm,nm){
for (var i_tem = 0, bobs=frm.elements; i_tem < bobs.length; i_tem++)
if(bobs[i_tem].name==nm&&bobs[i_tem].checked)
frm.action=bobs[i_tem].value;
}
You're Credit/Debit field needs to be updated with the appropriate URL to submit to:
HTML Code:
<input type="radio" name="bob" value="http://otherprocessor.com/service.whatever">Credit/Debit<br>
And, if you need to format the cart items differently, for the other processor, you can do in usePage() as well:
PHP Code:
function usePage(frm,nm){
for (var i_tem = 0, bobs=frm.elements; i_tem < bobs.length; i_tem++)
if(bobs[i_tem].name==nm&&bobs[i_tem].checked)
frm.action=bobs[i_tem].value;
if (frm.action == 'http://otherprocessor.com/service.whatever') {
// do whatever reformatting of form fields you need to do here.
// you could even build a hidden form, submit THAT, and return false here,
// to prevent the original form from submitting.
}
}
Bookmarks