Reputation: 27
I have stored some textbox values in cookies.
But if textbox blank then cookie value will "null"
I am assigning that cookie value to another textbox.But due to the null value of cookie it showing me "null" in textbox.
I want to replace "null" with a blank space.
Upvotes: 2
Views: 309
Reputation: 23555
It's hard to tell based on what you've said, but I think the problem might be that you are trying to access the textbox before it has loaded. Try something like this:
$(function() {
// your code here
});
And as others have mentioned, it would be a lot easier to just do this:
$('input[name="Orders\\.Custom_Field_Custom1"]').val($.cookie('UploadFile',{ path:'/'}));
Upvotes: 1
Reputation: 7675
Try with
$('input[name="Custom_Field_Custom7"]').val('11111');
Upvotes: 1
Reputation: 176896
Make uf of .val() function will do you task.
$('#youtextboxid').val(valueneedtoset);
Upvotes: 3