Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.help > #808
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Joshua Cranmer <Pidgeot18@verizon.invalid> |
| Newsgroups | alt.comp.lang.javascript, comp.lang.java.help, comp.lang.javascript |
| Subject | Re: Problem in other browsers than Internet Explorer |
| Followup-To | comp.lang.javascript |
| Date | Fri, 01 Jul 2011 21:13:06 -0700 |
| Organization | A noiseless patient Spider |
| Lines | 29 |
| Message-ID | <ium5sl$dbl$1@dont-email.me> (permalink) |
| References | <1752b646-2ce0-47ab-b9a0-1f006a758aed@f39g2000prb.googlegroups.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8; format=flowed |
| Content-Transfer-Encoding | 7bit |
| Injection-Date | Sat, 2 Jul 2011 04:13:09 +0000 (UTC) |
| Injection-Info | mx04.eternal-september.org; posting-host="bAymlyY9SkaJNa8Tz2rerw"; logging-data="13685"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/8ZMpRFMMgd1/QdJhWkEO+DZfbt9LbvsM=" |
| User-Agent | Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.18) Gecko/20110616 Lightning/1.0b2 Thunderbird/3.1.11 |
| In-Reply-To | <1752b646-2ce0-47ab-b9a0-1f006a758aed@f39g2000prb.googlegroups.com> |
| Cancel-Lock | sha1:pl+GlET6LUi5nWRYcuEG1NMKehw= |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.java.help:808 comp.lang.javascript:3572 |
Cross-posted to 3 groups.
Followups directed to: comp.lang.javascript
Show key headers only | View raw
On 7/1/2011 8:58 PM, Ilya Shambat wrote:
> I have code that works when I use Internet Explorer, but does not work
> when I use Mozilla Firefox.
>
> The code is
>
> var textpassed = document.getElementById(fieldname).value;
>
> where fieldname is the name of the field as defined in the document.
>
> Any other operations using similar code, such as
>
> alert ("In field " + document.getElementById(fieldname).name);
>
> returns valid results in Internet Explorer but not in Mozilla Firefox.
>
> Would anyone know the reasons for this, and is this possible to get
> around?
Despite the similarity in names, Java and JavaScript have nothing to do
with each other.
Nevertheless, my first guess is that the "ID" you're getting is the name
attribute of the field, and not the actual id field.
document.getElementsByName may be more up your alley.
--
Beware of bugs in the above code; I have only proved it correct, not
tried it. -- Donald E. Knuth
Back to comp.lang.java.help | Previous | Next — Previous in thread | Next in thread | Find similar
Problem in other browsers than Internet Explorer Ilya Shambat <ibshambat@gmail.com> - 2011-07-01 20:58 -0700 Re: Problem in other browsers than Internet Explorer Joshua Cranmer <Pidgeot18@verizon.invalid> - 2011-07-01 21:13 -0700 Re: Problem in other browsers than Internet Explorer "Andy" <andy@NOSPAMmanyplay.com> - 2011-07-02 08:31 +0100 Re: Problem in other browsers than Internet Explorer "Evertjan." <exjxw.hannivoort@interxnl.net> - 2011-07-02 10:05 +0000 Re: Problem in other browsers than Internet Explorer Denis McMahon <denis.m.f.mcmahon@gmail.com> - 2011-07-05 18:24 +0000
csiph-web