TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Luis Alberto Delgado de la Flor
NA
127
23.1k
Execute JavaScript in a modal window
Jul 7 2017 3:35 PM
Hello,
I have the following JS code:
<script type=
"text/javascript"
>
$(document).ready(function () {
var items =
"<option value='0'>Select</option>"
;
$(
'#DistrictID'
).html(items);
});
</script>
This populate a dropdownlist with the value Select, the thing is, this dropdownlist appears in a form that it's called once the user clicks a button and then a modal windows opens, with the form in it.
But since it is mark as
$(document).ready
This JS won't execute with the modal, since the document is already 'ready'. How can I achieve this?
Thanks in advance!
Regards,
Reply
Answers (
3
)
Global variable is not updated javascript
How to show a color picker inside a bootstrap modal?