我有一个在 iframe 中打开的 adobe 标志表单。单击 adobe 签名表单中类名称为“agree-to-terms”的按钮时,我想更改网页上“提交”按钮的行为。所以基本上我有 2 个单选按钮和提交按钮(其中最初被禁用)在网页上。在选择“是”单选按钮时,iframe 正在打开,其中嵌入了 adobe 标志表单。我想在单击类名“同意条款”的按钮时启用提交按钮在 adobe 标志形式上。
这是我尝试过的
function ideaform() {
document.getElementById("myiframe").src = "adobe sign url";
$("#myiframe_forms").show();
$("#myfetching_form").show();
$('#idea_sbmt').css({
'background-color': '#0071ce',
'pointer-events': 'auto',
'border': '1px solid #0071ce',
'color': 'white'
});
setTimeout(function() {
$("#myfetching_form").hide();
}, 3000);
//I tried both the ways
1) $("#myiframe").load(function() {
$("#myiframe").contents().on("click", ".agree-to-terms", function() {
console.log("inside frame loaddddd")
});
});
2) $(document).ready(function() {
console.log("insideeeeeeee frameee")
$("#myiframe").contents(".agree-to-terms").click((functionToRun));
});
function functionToRun() {
console.log("alllllllllleeerrrrrrtttttttt")
}
<div id="submit-cont" style="display: flex; justify-content: space-between;">
<div>
<input type="radio" id="yes" name="yesno" value="yes" onchange="ideaform()">
<label for="yes">I understand. Take me to the agreement to review and sign if I
agree.</label><br><br>
<input type="radio" id="no" name="yesno" value="no" onchange="noideaform()">
<label for="no">No thank you. Let me think about it some more.</label><br>
</div>
<div>
<button id="idea_sbmt" onclick="showIdeaSubmission()">Submit</button>
</div>
</div>
<div id="myiframe_forms">
<div class="banner">
<div id="myDiv" class="img-wrapper">
<p class="close_button" onclick="dismiss_iframe_forms()"><b>Close</b></p>
<h1 id="myfetching_form" style="margin-top: 150px; color:#0071ce;"><b>Fetching your form...</b>
</h1>
<iframe id="myiframe" src=""></iframe>
</div>
</div>
</div>