I have inherited a piece of code which has a series of functions like the following:
$("#data[User][notify_one_day_out]").change(function () {
$("#updatenotificationsform").submit();
}
$("#data[User][notify_one_month_out]").change(function () {
$("#updatenotificationsform").submit();
}
and this goes on and on. How do I just write one function that does the same thing since every ID begins with data. Sorry am a JS newbie
Thanks
#data[User][notify_one_day_out]matchs the element with IDdataif theUserandnotify_one_day_outattributes are set. If they are part of the ID instead, you have to escape[].