0

I've this code example, to define my problem : jsfiddle.net/Architecte/KSDCM/

Can you help me to call the select in question?

Do you know why I can not call an id that contains hooks? Do I need to perform a specific action to do this?

In fact if I renommme selct my id in a "normal", everything works perfectly.

But for me to validate my post later in this call, I have to keep these tables up.

1

4 Answers 4

1

Escape the special characters with \\:

$('#f1\\[sector\\]')

See http://docs.jquery.com/Frequently_Asked_Questions#How_do_I_select_an_element_by_an_ID_that_has_characters_used_in_CSS_notation.3F

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

Comments

0

I think the problem is that you [ and ] in your elements id

1 Comment

Yes I know this, but this is how can I ignore or consider?
0

Like Tetaxas said, you can either escape special characters in the id, or use this selector instead

$('select[id="f1[sector]"]').html();

Here's a fiddle.

Comments

0

use

$('#newtechnicalsheet').click(function() {
    alert($('select[id="f1[sector]"]').html());
});

or

$('#newtechnicalsheet').click(function() {
    alert($('select[name="f1[sector]"]').html());
});

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.