0

Hello I have this function that will delete all the empty fields in the form:

 $('input:text[value=""]', '#submForm').remove();

But as I said it will remove ALL the empty fields.

I need instead to check and remove only specific Fields with a Specific ID.

How do I change this function to remove only the the Fields I want and not every field in the form?

EDIT: Not specific Fields by using each ID of each Field. But all the Fields that are inside a Specific DIV id.

Thanks

1
  • Can you show the relevant html? Commented Jul 22, 2011 at 9:05

2 Answers 2

2

Extend your selector like this:

$('div#someID input:text[value=""]', '#submForm').remove();

(assuming that the div is also a descendant of #submForm)

Sign up to request clarification or add additional context in comments.

Comments

0
$("#divid").children().remove();

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.