Jump to content

jQuery : Retrieving VALUES


Andy11548

Recommended Posts

Sorry for the double topic. I realised that I didn't explain it right in the other topic.

 

Right, I have multiple values comming from the same class name.

 

How would I go around retrieving all the values from the same class name.

 

<input type="hidden" class="test" value="1" />

<a href="#">Delete</a>

-----------------------------------------------------------

<input type="hidden" class="test" value="2" />

<a href="#">Delete</a>

-----------------------------------------------------------

<input type="hidden" class="test" value="3" />

<a href="#">Delete</a>

-----------------------------------------------------------

<input type="hidden" class="test" value="4" />

<a href="#">Delete</a>

 

Right, thats pretty much it (not exactly how it is). However, when I try and retrieve the values, it only lets me click on the first "Delete" link. The others will not work as it's only picking up the first Value.

 

If I deleted the first topic (value="1"), the Delete Link then works for Value 2.

 

How do I make them ALL work?

Link to comment
https://forums.phpfreaks.com/topic/253519-jquery-retrieving-values/
Share on other sites

When the confirm its the one they want to select, it will send the value (being the ID of the post) to a PHP script that will delete it.

 

I just need to get it to recognise the values independantly.

 

Also, each delete link has a ID that is like

<input type="submit" value="Test button" id="test_'.$testF['id'].'" />

 

So, each link has a different number after the "test_" part.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.