Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing required="required" with jQuery does not work in IE7 or 8 #4

Open
brupm opened this issue Jan 23, 2012 · 2 comments
Open

Removing required="required" with jQuery does not work in IE7 or 8 #4

brupm opened this issue Jan 23, 2012 · 2 comments

Comments

@brupm
Copy link

brupm commented Jan 23, 2012

I set a text field required="required" on the html side
<input type="text" name="title" id="title_input" placeholder="e.g. Placeholder" value="some value" required="required" maxlength="200" />

then upon user input I use jQuery to trigger a the following change:

jQuery("#title_input").prop('required', false);

The error message is no longer shown on FF, Chrome or Safari if the field is left empty, but it still persists in IE even though the prop has been set to false. I tried with removeAttr() and well as removeProp(), same issue.

I noticed that in the source code you use $$.attr('required'), I tried using $$.prop('required') but that did not make a difference.

My goal is to be able to change field requirements with jQuery post page load depending on user input.

Thank you

@akaspin
Copy link
Owner

akaspin commented Jan 24, 2012

Hmm. To be honest, I just had no idea that one wants to manipulate the form properties via jQuery. Can you show me example?

@maletor
Copy link

maletor commented Jun 26, 2012

You have to run $('form').f5() on the DOM after writing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants