javascript element search

Hi,
 I am using this javascirpt fuction but my page contains around 5000 controls as we are using regulare expression its taking time to load the page some times it stop processing. Is there any other way to do this with out regexpression.

<html>
<head>
<script language="javascript">
function fill()
{
  var re = /^txtJpn_(\d+)/;
  var match;

  for (var i = 0; i < document.forms[0].elements.length; i++)
  {
     match = re.exec(document.forms[0].elements[i].name);
     if (match) {
         document.getElementById("txtOthers_" + match[1]).value = document.forms[0].elements[i].value;
     }
  }
}
</script>
</head>
<body>
<form>
<input type="text" name="txtJpn_0" >
<input type="text" name="txtOthers_0">
<input type="text" name="txtJpn_1">
<input type="text" name="txtOthers_1">
<input type="text" name="txtJpn_2">
<input type="text" name="txtOthers_2">
<input type="text" name="txtJpn_3">
<input type="text" name="txtOthers_3">
<input type="text" name="txtJpn_4">
<input type="text" name="txtOthers_4">
<input type="text" name="txtJpn_5">
<input type="text" name="txtOthers_5">
<input type="text" name="txtJpn_6">
<input type="text" name="txtOthers_6">
<input type="button" onclick="fill();" value="Fill">
</form>
</body>
</html>
sateeshkumarjAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

sateeshkumarjAuthor Commented:
this question is a continuation of this below question.
http://www.experts-exchange.com/Web/Web_Languages/JavaScript/Q_21823189.html
ZvonkoSystems architectCommented:
Here an example:

<html>
<head>
<title>Zvonko &#42;</title>
<script language="javascript">
function fill(theBtn){
  var theForm = theBtn.form;
  for(var i=0;theForm["txtJpn_"+i];i++){
    theForm["txtOthers_"+i].value = theForm["txtJpn_"+i].value;
  }
}
</script>
</head>
<body>
<form>
<input type="text" name="txtJpn_0" >
<input type="text" name="txtOthers_0"><br>
<input type="text" name="txtJpn_1">
<input type="text" name="txtOthers_1"><br>
<input type="text" name="txtJpn_2">
<input type="text" name="txtOthers_2"><br>
<input type="text" name="txtJpn_3">
<input type="text" name="txtOthers_3"><br>
<input type="text" name="txtJpn_4">
<input type="text" name="txtOthers_4"><br>
<input type="text" name="txtJpn_5">
<input type="text" name="txtOthers_5"><br>
<input type="text" name="txtJpn_6">
<input type="text" name="txtOthers_6"><br>
<input type="button" onclick="fill(this);" value="Fill">
</form>
</body>
</html>

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ZvonkoSystems architectCommented:
Please explain why you graded my support with the grade B.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.