Skip to main content

I have the following input <input value="25" data-hidden-value="25" name="associations[agencies][ids][]" data-hidden-name="associations[agencies][ids][]" class="string" type="hidden">

<input value="25" data-hidden-value="25" name="associations[agencies][ids][]" data-hidden-name="associations[agencies][ids][]" class="string" type="hidden"> 

This input is dynamically generated, and don't have any ID. I'm trying to get the value using the following code:

campaignId = $("input[name='associations[agencies][ids][]]'").val(); 

But I always get undefined

Some help please.

I have the following input <input value="25" data-hidden-value="25" name="associations[agencies][ids][]" data-hidden-name="associations[agencies][ids][]" class="string" type="hidden">

This input is dynamically generated, and don't have any ID. I'm trying to get the value using the following code:

campaignId = $("input[name='associations[agencies][ids][]]'").val(); 

But I always get undefined

Some help please.

I have the following input

<input value="25" data-hidden-value="25" name="associations[agencies][ids][]" data-hidden-name="associations[agencies][ids][]" class="string" type="hidden"> 

This input is dynamically generated, and don't have any ID. I'm trying to get the value using the following code:

campaignId = $("input[name='associations[agencies][ids][]]'").val(); 

But I always get undefined.

Source Link
Jean
  • 5.4k
  • 11
  • 55
  • 91

Get input value

I have the following input <input value="25" data-hidden-value="25" name="associations[agencies][ids][]" data-hidden-name="associations[agencies][ids][]" class="string" type="hidden">

This input is dynamically generated, and don't have any ID. I'm trying to get the value using the following code:

campaignId = $("input[name='associations[agencies][ids][]]'").val(); 

But I always get undefined

Some help please.