> Hi all,
>
[quoted text clipped - 7 lines]
>
> Can anyone help point me in the right direction?
Boil your code down to a basic page that demonstrates the problem - and post
it here.
(What type of input fileds are you working with that have several with the
same name ? - ?Radio Buttons?)
usually, in javascript, you can access the field directly as :
document.formName.ElementName.value .
2¢
HTH
da_rod_father - 17 Mar 2006 00:08 GMT
The type of input fields are text and the reason that they have the
same name is that I am dynamically building the rows that the input
fields are in. They have the same name but different values. Here is
a snippet of code that I am working with. I only want to check for
duplicate values that are of the name="prop".
<script>
function setPropField(formField,indx,secName,header){
var frm = document.setPropertyForm;
frm.prop.value = formField.value;
frm.indx.value = indx;
frm.secName.value = secName;
frm.header.value = header;
thisProp = formField.value;
var dupeFrm = document.checkForPropDuplicatesForm;
var propVals = dupeFrm.document.getElementsByName("prop");
for( var i = 0; i < propVals.length; i++) {
thisElem = propVals[i].value;
if( thisProp == thisElem ) {
alert("This is a duplictae value" +
"\n Please create another" );
return false;
}
}
}
</script>
<% SortedMap props = (SortedMap) headers.get(sectionName);
Set set = props.keySet();
Iterator it = set.iterator();
Object pval = "";
Object vval = "";
while (it.hasNext()) {
pval = (Object) it.next();
vval = (Object) props.get(pval);
iii++;
%>
<tr>
<td colspan="4" width="100%">
<table class="summaryTable" width="100%">
<tr class="tableTitle" style="border:0px;padding:0px;">
<td colspan="4"><span class="style2">Add Property and
Value</span></td>
</tr>
<tr class="headerRow firstColor">
<td>ENV</td>
<td>Name</td>
<td>Value</td>
</tr>
<tr class="firstColor">
<td><strong>ADA</strong></td>
<td><input name="prop" id="prop" value="" size="50"
onchange="setPropField(this,'<%=iii %>','<%=sectionName %>','<%=header
%>');"></input></td>
<td><input name="propVal" id="propVal" value="" size="85"
onchange="setValField(this,'<%=iii %>','<%=sectionName %>','<%=header
%>');"></input></td>
</tr>
<tr>
<td colspan="3" align="right"><img onclick="submit();"
src="images/btnBigSave.gif"></td>
</table>
</td>
</tr>
<% } %>
Hal Rosser - 18 Mar 2006 07:14 GMT
Why not try giving each text box its own unique name - then accessing them
that way ?