Results 1 to 3 of 3

Thread: How to pass value to object data

  1. #1

    Thread Starter
    Hyperactive Member nUflAvOrS's Avatar
    Join Date
    Jul 2007
    Location
    Malaysia/ Currently at Singapore
    Posts
    372

    How to pass value to object data

    Hi All,

    I want to pass the value to my object id = "Parameters"
    How can I do that?
    I had tried the code as posted below but it couldn't work.
    I'm using document.all.Parameters.data = tempParams[0]; to pass in the data to
    <OBJECT id="Parameters" style="Z-INDEX: 200; LEFT: 0px; TOP: 0px; POSITION: ABSOLUTE;" type=application/pdf height=800
    width=1060 VIEWASTEXT scroll=yes></OBJECT> Object





    HTML Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    
    
    
    <html>
    <head>
    <title>Management System Manual</title>
    
    
    
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    
    <script language="JavaScript" type="text/JavaScript">
    <!--
    function MM_reloadPage(init) {  //reloads the window if Nav4 resized
      if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
        document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
      else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
    }
    MM_reloadPage(true);
    
    function right(e) {
    if (navigator.appName == 'Netscape' && 
    (e.which == 3 || e.which == 2))
    return false;
    else if (navigator.appName == 'Microsoft Internet Explorer' && 
    (event.button == 2 || event.button == 3)) {
    alert("Sorry, you do not have permission to right click.");
    return false;
    }
    return true;
    }
    
    document.onmousedown=right;
    document.onmouseup=right;
    if (document.layers) window.captureEvents(Event.MOUSEDOWN);
    if (document.layers) window.captureEvents(Event.MOUSEUP);
    window.onmousedown=right;
    window.onmouseup=right;
    //  End -->
    </script>
    
    <script type="text/javascript" language="JavaScript1.2"> 
    <!-- // Begin
    //Disable right click script
    //no alert
    
    var message="";
    ///////////////////////////////////
    
    function onKeyDown() {
    if ( (event.altKey) || ((event.keyCode == 8) && 
    (event.srcElement.type != "text" &&
    event.srcElement.type != "textarea" &&
    event.srcElement.type != "password")) || 
    ((event.ctrlKey) && ((event.keyCode == 82)) ) ||
    (event.keyCode == 68) || 
    (event.keyCode == 80) ||
    (event.keyCode == 78) ||
    (event.keyCode == 66) ||
    (event.keyCode == 72) ||
    (event.keyCode == 73) ||
    (event.keyCode == 74) ||
    (event.keyCode == 70) ||
    (event.keyCode == 122) 
    ) {
    event.keyCode = 0;
    event.returnValue = false;
    }
    }
    
    function clickIE() {if (document.all) {(message);return false;}}
    function clickNS(e) {if 
    (document.layers||(document.getElementById&&!document.all)) {
    if (e.which==2||e.which==3) {(message);return false;}}}
    if (document.layers) 
    {document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
    else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
    
    document.oncontextmenu=new Function("return false")
    
    
    
    
    //  End -->
    </script>
    <script type="text/javascript" language="JavaScript1.2"> 
    
    
    function getParams() {
    var idx = document.URL.indexOf('?');
    var idx1 = document.URL.indexOf('#');
    var tempParams = new Object();
    
    if (idx != -1) {
    var pairs = document.URL.substring(idx+1, idx1).split('?');
    
    //pairs = 1;
    for (var i=0; i<pairs.length; i++) {
    nameVal = pairs[i].split('=');
    
    tempParams[0] = nameVal[1];
    }
    }
    
    //document.getElementById("Parameters").data = tempParams[0];
    //document.all.Parameters.data = tempParams[0];
    
    document.all.Parameters.data = tempParams[0];
    //alert (window.document.parameters.data);
    
    return false;
    }
    
    
    </script >
    
    </head>
    
    <style media="print">
    body 
    {
    display : none;
    }
    </style>
    
    </HEAD>
    
    </head>
    
    <!-- <body ondragstart="return false" onselectstart="return false" onkeydown=onKeyDown() onload=setInterval("window.clipboardData.clearData();getParams();",2)  oncontextmenu="return false" scroll=yes > -->
    <body ondragstart="return false" onselectstart="return false" onkeydown=onKeyDown() onload=getParams() oncontextmenu="return false" scroll=yes  >
    
    <!--<input id="abc" type="text"/>-->
    <form id="frmRestricted" method="post">
    
    <div id="Layer2" style="position:absolute; left:0px; top:-35px; width:1060; height:800; z-index:201"> 
      <OBJECT id="Parameters" style="Z-INDEX: 200; LEFT: 0px; TOP: 0px; POSITION: ABSOLUTE;" type=application/pdf height=800 
    	width=1060 VIEWASTEXT  scroll=yes></OBJECT>
    </div> 
    </form>
    </body>
    </html>
    Thanks for help :-)
    Where there is no hope, there can be no endeavor.

    There are two ways of rising in the world, either by your own industry or by the folly of others.

  2. #2
    Frenzied Member
    Join Date
    Apr 2009
    Location
    CA, USA
    Posts
    1,516

    Re: How to pass value to object data

    Not sure if this is the only thing needing to be fixed, but "document.all" is essentially obsolete. Use this instead:
    Code:
    document.getElementById("Parameters").data = tempParams[0];

  3. #3

    Thread Starter
    Hyperactive Member nUflAvOrS's Avatar
    Join Date
    Jul 2007
    Location
    Malaysia/ Currently at Singapore
    Posts
    372

    Re: How to pass value to object data

    Thanks SambaNeKo,

    I had also tried the solution you given to me.
    It only worked for textbox or label control.
    How about Object to call out the pdf files?
    Where there is no hope, there can be no endeavor.

    There are two ways of rising in the world, either by your own industry or by the folly of others.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width