Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6662139
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:21:29+00:00 2026-05-26T02:21:29+00:00

I have a doubt in javascript. Is it posible to get the values of

  • 0

I have a doubt in javascript. Is it posible to get the values of text boxes with the same name ?

for example

<INPUT TYPE="text" NAME="inputbox" VALUE="">
<INPUT TYPE="text" NAME="inputbox" VALUE="">

these text boxes have same name, how can i get its values by name ?

OK, lemme come to the real problem i got, hope am explaining correctly.

I have a series of text boxes which i gotta validate now. Its not a big deal to validate textboxe normally.

But this is an array of text boxes where the id of the text boxes will be available only when the fields are added dynamically by clicking on the + button. when the press button is clicked the whole set of text boxes will appear. as many times its clicked, it will get added.

So its imposible to get the values to validate with the ID, so i tried by name.

JAVASCRIPT FUNCTION

function insComep()
    {

    // $("#doctorPri").validationEngine("updatePromptsPosition")  
// jQuery("#doctorPri").validationEngine('attach', {promptPosition : "topRight"});

        rl=document.getElementById("compeTable").rows.length;
        var a=document.getElementById("compeTable").insertRow(rl);

        var g=a.insertCell(0);
        var f=a.insertCell(1);  
        var m=a.insertCell(2);  
        var n=a.insertCell(3);  
        var o=a.insertCell(4);  
        var p=a.insertCell(5);
        var q=a.insertCell(6);
        var r=a.insertCell(7);
        var s=a.insertCell(8);
        var t=a.insertCell(9);
        //var v=a.insertCel1l(11);
        //var u=a.insertCell(12);
g.innerHTML='<select name="competproduct[]" style="width:86px" id="competproduct'+rl+'" class="validate[required]" ><option value="">--Select--</option><?echo $product_str;?></select>';
f.innerHTML='<input type="text" name="competcompany[]" id="competcompany'+rl+'" size="10" class="validate[required]" >';
m.innerHTML='<input type="text" name="competbrand[]" id="competbrand'+rl+'" size="10" class="validate[required]" >';
n.innerHTML='<input type="text" name="competdrug[]" id="competdrug'+rl+'" size="10" class="validate[required]" >';
o.innerHTML='<input type="text" name="competquty[]" id="competquty'+rl+'" size="2" class="validate[required,custom[integer]] text-input" >';
p.innerHTML='<input type="text" name="competprice_frm[]" id="competprice_frm'+rl+'" size="2" class="validate[required,custom[number],funcCall[getPriceFromE]] text-input" />';
q.innerHTML='<input type="text" name="competprice_to[]" id="competprice_to'+rl+'" size="2" class="validate[required,custom[number],funcCall[getPriceTo]] text-input" />';
r.innerHTML='<input type="text" name="competmrp[]" id="competmrp'+rl+'" size="2" class="validate[required,custom[number],funcCall[getMrp]] text-input"/>';
s.innerHTML='<select name="ChemistParma[]" style="width:86px" id="ChemistParma'+rl+'" style="width:86px" ><option value="">--Select--</option><?echo $chemist_str;?></select>'; 
t.innerHTML='<img src="media/images/details_close.png" onClick="delCompe('+rl+'); "/>';
// jQuery("#doctorPri").validationEngine('attach', {promptPosition : "topRight"});


     $("#doctorPri").validationEngine('hideAll');
    }

HTML

<table width="100%" id='compeTable' border='0' style='margin-left:auto;margin-right:auto;margin-top:40px;' >


<tr style="border-bottom:1px solid #999999;"><td colspan='4'>
<div style="background:;padding:3px;text-align:left; ">
    <font color='black'><strong  >Competitor Detail(s):</strong></font><font color="red">*</font>
</div>

</td></tr>



        <tr>
        <td>Product Name:<font color="red">*</font></td>
<td>Company Name:<font color="red">*</font></td>
<td>Brand Name:<font color="red">*</font></td>
<td>Drug Name:<font color="red">*</font></td> 
<td> Quantity:<font color="red">*</font></td>
<td>Pricefrom Dist:<font color="red">*</font></td>
<td   >Price to Dist:<font color="red">*</font></td>
<td> MRP:<font color="red">*</font></td>
<td>Chemist<font color="red">*</font><input type='button'value='+' style='width:1px' style='width:1px'  onclick='frame5()'/> 
</td>
<td></td>
</tr>
<tr><td>&nbsp;</td></tr>


            <tr>


                    <td>
                    <select name='competproduct[]' id='competproduct' style="width:86px" class="validate[required]" >
                    <option value=''>-select Product-</option>
                    <? echo $product_str;?>

                    </select>
                </td>

                <td>
                    <input type="text" name="competcompany[]"  id="competcompany" size="10" class="validate[required]" >
                </td>
                <td   ><input type="text" name="competbrand[]" id="competbrand" size="10" class="validate[required]" >
                </td>
                <td><input type="text" name="competdrug[]" id="competdrug" size="10" class="validate[required]" >
                </td>
                <td><input type="text" name="competquty[]"  id="competquty" size="2" class="validate[required,custom[integer]] text-input" >
                </td>
                <td>
<input type="text" name="competprice_frm[]" id="competprice_frm" size="2" class="validate[required,custom[number],funcCall[getPriceFromE]] text-input" />

                </td>
                <td>
                <input type="text" name="competprice_to[]" id="competprice_to" size="2" class="validate[required,custom[number],funcCall[getPriceTo]] text-input" />
                </td>
                <td><input type="text" name="competmrp[]" id="competmrp" size="2" class="validate[required,custom[number],funcCall[getMrp]] text-input" onBlur=''/>
                </td>
<td>
<select name='ChemistParma[]' id='ChemistParma'  style="width:86px">
<option value=''>-select chemict-</option>
<?echo $chemist_str?>
</select></td>
<td>
<img src="media/images/details_open.png" onClick="insComep()"/>
</td>

                </tr>
        </table>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T02:21:30+00:00Added an answer on May 26, 2026 at 2:21 am

    It’s quite simple,

    document.getElementsByName("inputBox");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to be able to do something like <input type=text name=txtField value= title=input
I have a doubt regarding the backlog value in listen system call. From man
i have a doubt that whether javascript expression is better or regularexpression is better.
I m just learning regular expression matching using javascript, and have a doubt regarding
I have a small doubt , I am using facebook javascript sdk to authenticate
I am new to stackoverflow i have doubt regarding calling jsp from javascript file.
I am kind of very new to javascript world. I have a doubt. How
I have a doubt. I need to get the data from the sever twice
Possible Duplicate: What is the difference between const and readonly? i have doubt in
I have a doubt: - Is there any standard/convention that when should I use

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.