Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5

Thread: Self.opener

  1. #1
    New to the CF scene
    Join Date
    Apr 2008
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Self.opener

    Hi ¡¡

    I write in a text box and sending it to a select multiple. This code works perfectly in firefox, but not in Internet Explorer. Anyone know why?

    Thank you very much

    The code:

    Code:
    function MM_openBrWindow(theURL,winName,features) {
    window.open(theURL+'?tag='+document.form1.usuario.value,winName,features); 
    }

    Code:
    <script language="JavaScript">
    function test3(valor,valor2) {
      self.opener.document.form1.idoc.value=valor2; //idoc is hidden
      self.opener.document.form1.txtoc.value=valor; //txtoc is hidden
    
      obj2=self.opener.document.getElementById('seleccionados'); 
      opc = new Option(valor2,valor); 
      eval(obj2.options[obj2.options.length]=opc);
      window.close();
    }
    </script>

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,854
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    I'm sorry, but the above code should exhibit the same behavior in almost all browsers for us (haven't tested though)

    You need to show the rest of your code, the html part
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    New to the CF scene
    Join Date
    Apr 2008
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Sorry ¡
    The pop up:
    Code:
    <script language="JavaScript">
    function test3(valor,valor2) {
      self.opener.document.form1.idoc.value=valor2; //idoc is hidden
      self.opener.document.form1.txtoc.value=valor; //txtoc is hidden
    
      obj2=self.opener.document.getElementById('seleccionados'); 
      opc = new Option(valor2,valor); 
      eval(obj2.options[obj2.options.length]=opc);
      window.close();
    }
    </script>
    
    
    
    <body>
    <%
    
    var=request.QueryString("tag")%>
    
    
    <%
    
    
    
    		strConn = "driver={SQL Server};server="&session("ipfija")&";UID="&session("dbfija")&";PWD="&session("passfija")&";database="&session("dbfija")
    
    		Set Conexion= Server.CreateObject("ADODB.Connection")
    		Conexion.Open strConn
    		Set Registro = CreateObject("ADODB.RecordSet")
    		DnsText2 = *************************************
    		tipousuario="1"
    		heren="0"
    		SqlTexttag6 = "SELECT * FROM tags WHERE nombre='"&var&"' and tipo="&tipousuario
    		Registro.Open SqlTexttag6, DnsText2,3,3
    		if not Registro.eof then
    			response.write("EXISTE")
    			Response.write (Registro("id"))
    			idoc=Registro("id")
    			session("idoc")=idoc
    		else
    			Conexion.Execute ("INSERT INTO Tags (nombre, herencia, tipo) VALUES ('"&var&"', '0', '"&tipousuario&"')")
    			set Registro2 = Conexion.execute("select MAX(ID) from tags")
    			idoc=Registro2(0)
    			session("idoc")=idoc
    		END IF
    
    %>
    
    
    <script language="JavaScript" type="text/javascript">
    	test3('<%=idoc%>','<%=var%>');
    </script>
    
    </body>

    The main page:
    Code:
    function MM_openBrWindow(theURL,winName,features) {
    window.open(theURL+'?tag='+document.form1.usuario.value,winName,features); 
    }
    
    
    <td width="41%"><%if identificador="" then%>
    <select name="seleccionados" size="15" multiple class="textonormal" id="seleccionados" style=" font-size:9px;width:200px " ondblclick="eliminar(this.form)">
    </select>
    <%else%>
    <select name="seleccionados" size="15" multiple class="textonormal" id="seleccionados" style=" font-size:9px;width:200px " ondblclick="eliminar(this.form)">
    <%Set Rstag = CreateObject("ADODB.RecordSet")
    SqlTexttag = "SELECT idtag FROM relacional WHERE tipo=0 and idOrigen="&identificador
    Rstag.Open SqlTexttag, DnsText2,3,3
    if not Rstag.eof then
    Do while not rstag.eof
    Set Rs3 = CreateObject("ADODB.RecordSet")
    SqlText3 = "SELECT nombre FROM Tags WHERE id="&rstag("idtag")
    Rs3.Open SqlText3, DnsText2,3,3
    if not Rs3.eof then
    nombredeltag=rs3("nombre")
    end if
    rs3.close
    %>
    <option value=<%=rstag("idtag")%>><%=nombredeltag%></option>
    <%rstag.movenext
    
    loop
    end if
    
    Rstag.close%>
    </select>
    <%end if%>                  </td>
    
    
    
      <td><span class="Estilo14">Nuevo Tag:</span>
                          <input id="usuario" name="usuario" type="text">
                          <br>
                          <input id="idoc" type="hidden">
                        <input id="txtoc" type="hidden"></td>
                      <td><input name="add2" type="button" id="add" value="&nbsp;>&nbsp;" onClick="MM_openBrWindow('/control/basededatos/grabartag.asp','','scrollbars=yes,width=0.01,height=0.01')"></td>

  • #4
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,854
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    That also doesn't make any difference either! How can we execute that server side script?
    Take the generated client side code (from browser's view source option) and post the relevant parts.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #5
    Regular Coder mjlorbet's Avatar
    Join Date
    Jan 2008
    Location
    Milwaukee, WI
    Posts
    724
    Thanks
    8
    Thanked 96 Times in 95 Posts
    use window.opener instead of self.opener
    -Mike
    "Want me to precludify him, like some kind of dispatcherator?... Can do!" -Bender


  •  

    Posting Permissions

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