Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 04-29-2008, 03:41 PM   PM User | #1
FlashO
New to the CF scene

 
Join Date: Apr 2008
Posts: 7
Thanks: 1
Thanked 0 Times in 0 Posts
FlashO is an unknown quantity at this point
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>
FlashO is offline   Reply With Quote
Old 04-29-2008, 03:58 PM   PM User | #2
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,689
Thanks: 158
Thanked 2,184 Times in 2,171 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
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
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Old 04-29-2008, 04:28 PM   PM User | #3
FlashO
New to the CF scene

 
Join Date: Apr 2008
Posts: 7
Thanks: 1
Thanked 0 Times in 0 Posts
FlashO is an unknown quantity at this point
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>
FlashO is offline   Reply With Quote
Old 04-29-2008, 04:31 PM   PM User | #4
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,689
Thanks: 158
Thanked 2,184 Times in 2,171 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
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.
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Old 04-29-2008, 04:52 PM   PM User | #5
mjlorbet
Regular Coder

 
mjlorbet's Avatar
 
Join Date: Jan 2008
Location: Milwaukee, WI
Posts: 724
Thanks: 8
Thanked 96 Times in 95 Posts
mjlorbet will become famous soon enough
use window.opener instead of self.opener
__________________
-Mike
"Want me to precludify him, like some kind of dispatcherator?... Can do!" -Bender
mjlorbet is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:17 PM.


Advertisement
Log in to turn off these ads.