JS - Get element by part of name or id

MikeW

New Member
Here is an example of my form (only inputs that I want, but there is many others) :\[code\]<form name="inputform" action="..." method="post"><input type="hidden" name="id_qtedje_77" id="id_qtedje_77" value="http://stackoverflow.com/questions/15874630/0"><input type="text" id="id_qte_77" name="prestation_detail_fields[77][qte_collecte]" value="http://stackoverflow.com/questions/15874630/0.00"><input type="text" id="id_rec_77" name="prestation_detail_fields[77][reliquat_conforme]" value="http://stackoverflow.com/questions/15874630/0.00"><input type="text" id="id_ren_77" name="prestation_detail_fields[77][reliquat_non_conforme]" value="http://stackoverflow.com/questions/15874630/0.00"><input type="checkbox" name="prestation_detail_fields[77][dechet_non_present]" value="http://stackoverflow.com/questions/15874630/1"><!-- another TR --><input type="hidden" name="id_qtedje_108" id="id_qtedje_108" value="http://stackoverflow.com/questions/15874630/0"><input type="text" id="id_qte_108" name="prestation_detail_fields[108][qte_collecte]" value="http://stackoverflow.com/questions/15874630/0.00"><input type="text" id="id_rec_108" name="prestation_detail_fields[108][reliquat_conforme]" value="http://stackoverflow.com/questions/15874630/0.00"><input type="text" id="id_ren_108" name="prestation_detail_fields[108][reliquat_non_conforme]" value="http://stackoverflow.com/questions/15874630/0.00"><input type="checkbox" name="prestation_detail_fields[108][dechet_non_present]" value="http://stackoverflow.com/questions/15874630/1"></form>\[/code\]What I want is to get values of inputs, but as the form is built in PHP, I don't know the line identifier (77, 108).Is there a way to do something like \[code\]getElementByName('id_qtedje_%')\[/code\] ?Note: I'm not using any library, and I don't plan to use one.
 
Top