Could you explain this one a little more? How you coded it is a little confusing to me.
On Apr 13, 6:34 pm, mkmanning <michaell...@gmail.com> wrote: > If I understand you code, you're trying to create an array of > name=value, with value being specifically set if the name has _test in > it? > > var arr = $.map($('input'),function(n,i){ > return n.name+'='+(n.name.indexOf('_test')!=-1?'some_value':n.value); > > }); > > On Apr 13, 5:27 pm, Nic Hubbard <nnhubb...@gmail.com> wrote: > > > I have input values that I am adding to a array. I would like to be > > able to check if any of them end in _test and if so, I need to set a > > specific value. Is there any, in an if statement, to check if an > > attribute of one of the input fields ends with _test? > > > main_form.find('input').each(function() { > > arr_current_item2.push($(this).attr('name') + '=' + $(this).val()); > > > });// End each