1

I have a form inside an iframe, now I want to get the input with certain name. The id of my iframe is "myFrame". I was able to take out the inputs inside the iframe by $("#myFrame").contents().find("input") but i want the input by name, so i did $("#myFrame").contents().find("input[name=input_id]") but with failure. Can anybody help me with this?

2 Answers 2

2

If input_id is a variable, you need to concatenate the input_id:

$("#myFrame").contents().find("input[name='" + input_id + "']");
Sign up to request clarification or add additional context in comments.

Comments

1

Have you tried (using double quotes):

   $("#myFrame").contents().find('input[name="input_id"]')

and when you say that you took out the inputs with:

   $("#myFrame").contents().find("input")

did you check that the input you wanted was inside that collection?

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.