Skip to content Skip to sidebar Skip to footer

After Refreshing The Page , I M Loosing The Input Button Field

I have js file which has this code in it table = table + '

Solution 1:

table = table + '<tdclass="mytd"><inputtype="button"style="display:none; width:40px;  color:White;  background-color:#00BFFF;"class="editButton"value="Edit"id="' + obj[i].orderid+ '"/></td>';

This has style="display: none" in the input tag.

So in JS when you are constructing the DOM in that way and append it to the HTML it will hidden by default.

As you said, when you call ('.editButton').show(); its shown to the user.

But when you refresh the page, the DOM is again constructed and all your JS changes will be lost. It doesn't preserve the JS changes and you need to do it again.

That's why its hidden always.

If you try to put

$(function() {
// table construction code here// append to body

('.editButton').show();
});

It will show the input box always when the page loads.

Am assuming that you are constructing the table before this line ;)

Post a Comment for "After Refreshing The Page , I M Loosing The Input Button Field"