Jump to content

how can i remove s specific hidden field


toolman

Recommended Posts

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
Share on other sites

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.

Edited by Xaotique
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.