473,412 Members | 2,075 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

Javascript in Mozilla Firefox

Hi everyone!

I'm having this problems with javascript. If you go to:
http://www.nikonistas.com/es_home/nikon2.html
you'll find at the top-left corner the typical username-password form with
the "send" button that actually does a javascript:envia(); (envia means send
in spanish).
The problem is that it does not work, no matter what I do it does not send
the information. I have Java and Javascrips activated and up to date.

Does anyone know what the problem could be?

Thanks a lot in advance!!!!!


Jun 2 '06 #1
1 1654
charales said the following on 6/2/2006 4:13 PM:
Hi everyone!
Hi, and please don't post attachments or binary files here. Thank you.
I'm having this problems with javascript. If you go to:
http://www.nikonistas.com/es_home/nikon2.html
you'll find at the top-left corner the typical username-password form with
the "send" button that actually does a javascript:envia(); (envia means send
in spanish).
OK. Bad idea but ok.
The problem is that it does not work, no matter what I do it does not send
the information. I have Java and Javascrips activated and up to date.

Does anyone know what the problem could be?


Yes, there are many many problems with that page and it's code other
than your form not getting submitted.

This is your envia function:

function envia()
{
if (nav=="ie")

//Please, tell us that you are not trying to distinguish
//IE based on the navigator object? Besides, it is not
//needed in this function anyway.

{
if (f1.elements[0].value == "")

//There is where your IE behavior is involved. f1 is the
//name of the form. Just refer to the form properly
// and you lose all interest in the browser.

{
alert("El número de nikonista es un campo obligatorio.");
f1.elements[0].focus();
//return (false);
}
else
if (f1.elements[1].value == "")
{
alert("El password es un campo obligatorio.");
f1.elements[1].focus();
//return (false);
}
else f1.submit();
}
else {

//This is the non-nav == "ie" branch.

if (document.clave.document.f1.elements[0].value == "")

//one look in the FF console tells you that document.clave
//has no properties.

if (document.f1.elements[0].value == "")

{
alert("El número de nikonista es un campo obligatorio.");
document.clave.document.f1.elements[0].focus();
//return (false);
}
else
if (document.clave.document.f1.elements[1].value == "")

//ditto here, document.clave has no properties
{
alert("El password es un campo obligatorio.");
document.clave.document.f1.elements[1].focus();
//return (false);
}

else document.clave.document.f1.submit();}

}

The entire function, re-written:

function envia()
{
if (document.f1.elements[0].value == "")
{
alert("El número de nikonista es un campo obligatorio.");
document.f1.elements[0].focus();
}
else
{
if (document.clave.document.f1.elements[1].value == "")
{
alert("El password es un campo obligatorio.");
document.f1.elements[1].focus();
}
else
{
document.f1.submit();
}
}
}

Although the idea of using the image the way you do eludes me:

<input type="submit" style="background: url(ok_ov.gif);background-color:
orange;width:20px;height:20px">

Would be a start towards a better idea.
--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jun 2 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Ryan Gaffuri | last post by:
I know that this works. I just don't get the syntax. I know its checking the OS. just not sure how it works. var v = navigator.appVersion.toUpperCase() if (1+v.indexOf('WIN98') os =...
14
by: Rene Grothmann | last post by:
I have managed to communicate between forms and Java applets. A button press sends the content of the text area to an applet, a second button gets some text from the applet and puts it into the...
8
by: chrisdude911 | last post by:
how do i add video into a javascript web page with my own custom buttons?
7
by: Coder | last post by:
Hi I have the following code in java script, it is not giving proper output in FIREFOX but running fine in IE... can anybody help me out to make this run in FIREFOX . <script...
11
by: minnesotti | last post by:
Hi there, I subscribed to a photographic pictures-hosting website which is heavy on JavaScript. My preferred latest browser Mozilla Firefox does not work with it -- no pictures are displayed and...
8
by: Matt Kruse | last post by:
http://news.zdnet.com/2100-1009_22-6121608.html Hackers claim zero-day flaw in Firefox 09 / 30 / 06 | By Joris Evers SAN DIEGO--The open-source Firefox Web browser is critically flawed in...
1
by: xtremebass | last post by:
Hello Bytes, i have a calender program which is created by using Javascript. when i execute that program using Internet Explorer,it works properly but when i tried in Mozilla firefox it didnt...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.