<html> <head> <title>Test</title> <script type="text/javascript"> function comblf() { var last = document.forms[0].elements("Last_Name").value; var first = document.forms[0].elements("First_Name").value; if(last.length > 1 && first.length > 1) { document.forms[0].elements('[01]lastfirst').value = last + ', ' + first; } } </script> </head> <body> <form action="#" method="post"> <input name="First_Name" type="text" /> <input name="Last_Name" type="text" onkeyup="comblf()" /><br /> <br /> <input name="[01]LastFirst" type="text" onchange="comblf();" /><br /> <br /> <input name="Submit" type="submit" value="submit" /></form> </body> </html>
I left the [01] out of the javascript, but the value you are going to submit will have it.
Note that I set the script to work as soon as you fill out the last name field for testing purposes.
Hope that helps.