1
When filling a form I created shortcuts to add data to dropdowns list
but when I close the window pop-up
, refresh the entire page.
I’m using the following code:
window.onunload = refreshParent; Function refreshParent() { window.opener.Location.Reload(); }
The problem when updating the whole page is, it clears the data you already entered. in the rest of the form however.
How to do to just refresh on dropdown
that we add data?
Yes, it can be done through an Ajax request but how do I only update the dropdown, because in the background this request you placed is similar to what I did but what I did was in javascript.
– djva
So it depends on how you are getting the information to add in the dropdown. You can set a
id
for this dropdown and with the information added in it, for example, imagine that the field is ainput
and that we’re using jQuery, it would be something like this:$("seuDropdown").find("option").val( $("input").val())
.– Javeson Yehudi