By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,543 Members | 2,037 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,543 IT Pros & Developers. It's quick & easy.

Something Wrong? IE works but Firefox ...

P: n/a
Allways I think Firefox was strong, enough ... and so far THE BEST Web-
browser (That what I Think) but, now Im fighting with it, may be Im
doing something wrong (of course that is what happend to me)

....
<script LANGUAGE="JavaScript">
<!--
var msg1="";
var msg2="";
function Mostrar(valor)
{
var
msg1=window.document.formulario2.seccionA.options[formulario2.seccionA.selectedIndex].value;
var
msg2=window.document.formulario2.proveedorA.option s[formulario2.proveedorA.selectedIndex].value;
var seccion='&seccion=' + msg1;
var proveedor='&proveedor=' + msg2;
location.replace(valor + seccion + proveedor);
}
//-->
</script>
<tr>
<td bgcolor="#cedfea"><div style="position:relative;top:8px;left:
35px; float:left;z-index:2;" class="titulos1">Detalle</div>
<div style="position:relative;top:0px;left:-30px;z-index:
1;float:left"><img src="../global/img/fondo_titulo2.gif" alt=""
border="0"></div>
<div style="position:relative;top:3px;left:30px;z-index:
1;float:left">
<form action="nada" method="GET" name="formulario2"
id="formulario2">
<select name="seccionA" style="width:150px;padding:
2px;height:17px;">
<!-- BEGIN option1 -->
<option value={valopt1}>{opt1}</option>
<!-- END option1 -->
</select>
</div>
<div style="position:relative;top:3px;left:50px;z-index:
1;float:left">
<select name="proveedorA" style="width:150px;padding:2px;height:
17px;">
<!-- BEGIN option2 -->
<option value={valopt2}>{opt2}</option>
<!-- END option2 -->
</select>
</form>
</div>
<div style="float:right; margin-top:4px;"><A
href="javascript:Mostrar('{additem}');"><img src="../global/img/
agregar.jpg" alt="" width="26" height="20" border="0" style="margin-
right:4px;"></a><A href="{delitem}"><img src="../global/img/
eliminar.jpg" alt="" width="26" height="20" border="0" style="margin-
right:4px;"></A><A href="{refresh}"><img src="../global/img/ok.jpg"
alt="" width="26" height="20" border="0" style="margin-right:4px;"></
A></div></td>
</tr>

Ok, IŽll try to explain what does do that. (My english is very WEAK)
now Im using some TPL - Pear functions. My idea is take a pair of html
- select - options to send a selection of this to a PHP (for update
old info). (Nothing AJAX yet I hope soon implement something about
this if you know some easy and good manual tell me - I was googling
for everywhere but I just sink)
Between <BEGIN option1and <END option1(the same with option2) I
load a pair of value.
With var {refresh}I send my PHP file catcher. Is where data will sent.

So, I just use JScript to click in A Href to call a JScript function
for make a redirect to my PHP. with this two parameters.
This Kind of code work in IExplorer 6 and 7, but in my Dear Firefox
didnŽt, do you know why? Thanks for your support!
Alvaro J. Vera.-

May 6 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On May 6, 1:00 am, "alvarojavierv...@gmail.com"
<alvarojavierv...@gmail.comwrote:
Allways I think Firefox was strong, enough ... and so far THE BEST Web-
browser (That what I Think) but, now Im fighting with it, may be Im
doing something wrong (of course that is what happend to me)
<script LANGUAGE="JavaScript">
Unless you are working with HTML 3.2, which would be a very odd
choice, your HTML is invalid. Broken HTML is a shaky foundation to
build JavaScript on.
<!--
These comments are worthless today, they're there to hide the JS from
Netscape 2 era browsers.
var msg1="";
var msg2="";
function Mostrar(valor)
{
var msg1
You have a variable called msg1 in the global scope (an empty string)
and now you create another one scoped to this function. Are you sure
you want to do that?
=window.document.formulario2.seccionA.options[
Most people leave the "window" off that. I'd also suggest using:

document.forms['forumulario2'].elements['seccionA'].options for
clarity.
formulario2.seccionA.selectedIndex].value;
formulario2 is undefined here... but the JavaScript console (or
Firebug) on Firefox should have told you that.
</script>
<tr>
I take it back. You aren't writing HTML 3.2, that is just plain
invalid. Use a validator.
http://validator.w3.org/

May 6 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.