toolman Posted October 9, 2013 Share Posted October 9, 2013 Hi there, I am trying to remove a specific hidden field from this code: <form action="form.php" method="get" name="BFORM"> <input type="hidden" name="agent" value="aaa"> <input type="hidden" name="tmp" value="aaa"> <input type="hidden" value="disc" name="tmp"> The one I want to remove this one: <input type="hidden" name="tmp" value="aaa"> How can I do this with jQuery? Thanks Link to comment https://forums.phpfreaks.com/topic/282843-how-can-i-remove-s-specific-hidden-field/ Share on other sites More sharing options...
codefossa Posted October 9, 2013 Share Posted October 9, 2013 If you want to remove the one named "tmp" with a value "aaa" you would want something like this. $("form input[name = 'tmp']").each(function() { if ($(this).val() == "aaa") $(this).remove(); }); But, maybe you just wanted to remove the first "tmp" field? $("form input[name = 'tmp']:eq(0)").remove(); It just really depends on the situation, and you didn't provide much information on what you actually want to accomplish. Link to comment https://forums.phpfreaks.com/topic/282843-how-can-i-remove-s-specific-hidden-field/#findComment-1453300 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.