Something Wrong? IE works but Firefox ...

  • Thread starter alvarojaviervera
  • Start date
A

alvarojaviervera

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.options[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 option1> and <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.-
 
D

David Dorward

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/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top