Click here to Skip to main content
15,892,927 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How can i disable a button in I-Frame after first click in ASP.NET, I'm trying

C#
function DisableSubmitBtn() {

    alert('hi1');
    document.getElementById('framenewquery').src = 'frmimgupload.aspx?qid=0';
    var gBrowserName = navigator.appName;
    alert(gBrowserName);
   // var gBrowserVer = parseInt(navigator.appVersion);
    if (gBrowserName == 'Netscape') {
        alert("hi3");
        // alert(document.getElementById("framenewquery").src);
        var iframe = document.getElementById('framenewquery');
        alert(iframe);
        var iframeDocument = iframe.contentDocument || iframe.contentWindow.document;
        alert(iframeDocument);
        var iframeContent;

        if (iframeDocument) {
            //iframeContent = iframeDocument.getElementById('btnsubmit');

            iframeDocument.getElementById('btnsubmit').disabled = true;
           // iframeContent.hasOwnProperty() = false;
        }


[edit]SHOUTING removed - OriginalGriff[/edit]
Posted
Updated 7-Jan-15 21:34pm
v2
Comments
OriginalGriff 8-Jan-15 3:34am    
DON'T SHOUT. Using all capitals is considered shouting on the internet, and rude (using all lower case is considered childish). Use proper capitalization if you want to be taken seriously.

1 solution

Disable it in its own click event handler. Here some suggestions: "How to disable a button after 1st click"[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900