Copying billing names into cardholder

This code will allow you to populate the cardholder name with the billing first and last name.

First, add the following in between <head> and </head>:

<script>
function copyNameToCardholder()
{

var form = document.epayform;
    var first = form.UMbillfname.value;
     var space = " ";
 var last = form.UMbilllname.value;
 var cardfirst = first.concat(space);
 var cardholder = cardfirst.concat(last);
 form.UMname.value= cardholder;

}
</script>

Next add onChange to the first and last name inputs:

<tr>
 <td bgcolor="#F0F0F0" width="234" align="right"><font face="Verdana" size="2">First Name:</font></td>
 <td bgcolor="#F0F0F0" width="450">
 <input type="text" name="UMbillfname" size="20" value="[UMbillfname]"></td>
</tr>
<tr>
 <td bgcolor="#F0F0F0" width="234" align="right"><font face="Verdana" size="2">Last Name:</font></td>
 <td bgcolor="#F0F0F0" width="450">
 <input type="text" name="UMbilllname" size="27" value="[UMbilllname]"></td>
</tr>

Becomes:

<tr>
 <td bgcolor="#F0F0F0" width="234" align="right"><font face="Verdana" size="2">First Name:
 </font></td><td bgcolor="#F0F0F0" width="450">
 <input type="text" name="UMbillfname" size="25" value="" onChange="copyNameToCardholder()"></td>
</tr>
<tr>
 <td bgcolor="#F0F0F0" width="234" align="right"><font face="Verdana" size="2">Last Name:
 </font></td><td bgcolor="#F0F0F0" width="450">
 <input type="text" name="UMbilllname" size="25" value="" onChange="copyNameToCardholder()"></td>
 </tr>

Remove the cardholder text box:

<tr>
 <td bgcolor="#F0F0F0" width="234" align="right"><font face="Verdana" size="2">Name as on Card:</font></td>
 <td bgcolor="#F0F0F0" width="450">
 <input type="text" name="UMname" size="25" value="[UMname]"></td>
</tr>

Lastly add UMname to the hidden input section by finding this:

<input type="hidden" name="UMcommand" value="[UMcommand]">
<input type="hidden" name="UMamount" value="[UMamount]">
<input type="hidden" name="UMtax" value="[UMtax]">
<input type="hidden" name="UMinvoice" value="[UMinvoice]">
<input type="hidden" name="UMcustid" value="[UMcustid]">
<input type="hidden" name="UMrecurring" value="[UMrecurring]">

And adding a this line:

<input type="hidden" name="UMname" value="">

Once saved, the form will automatically copy the billing name to the cardholder name field.