Reputation: 63
parent.document.getElementById('')
I am using above code to manipulate elements individually in parent document. but i want to select all text field of parent document in one call and make them readonly. Because there are more than 70 fields and setting their properties one by one will be a long code.
window.parent.$("form input:text").setAttribute("readOnly","true");
and
$(":text").parent().setAttribute("readOnly","true");
I have tried both of these above codes but nothing worked.
Upvotes: 0
Views: 2261
Reputation: 528
try this:
$("iframe").contents().find("form input:text").attr('readonly',true);
or
$("iframe").contents().find("form input[type=text]").attr('readonly',true);
Upvotes: 0
Reputation: 1
This worked for me:
window.parent.$("form input:text").attr('readonly','readonly');
Upvotes: 0
Reputation: 34
This should work for you,
$(':text').each(function () {
$(this).attr('disabled', 'disabled');
});
Upvotes: 0
Reputation: 528
i think this will work for you
window.parent.$("form input[type=text]").setAttribute("readOnly","true");
Upvotes: 0