Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #11482
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail |
|---|---|
| From | Jason C <jwcarlton@gmail.com> |
| Newsgroups | comp.lang.javascript |
| Subject | Blackberry-specific problem |
| Date | Tue, 7 Feb 2012 20:02:47 -0800 (PST) |
| Organization | http://groups.google.com |
| Lines | 98 |
| Message-ID | <3969324.4567.1328673767667.JavaMail.geo-discussion-forums@vbbfd4> (permalink) |
| Reply-To | comp.lang.javascript@googlegroups.com |
| NNTP-Posting-Host | 67.237.93.23 |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=ISO-8859-1 |
| Content-Transfer-Encoding | quoted-printable |
| X-Trace | posting.google.com 1328673867 26843 127.0.0.1 (8 Feb 2012 04:04:27 GMT) |
| X-Complaints-To | groups-abuse@google.com |
| NNTP-Posting-Date | Wed, 8 Feb 2012 04:04:27 +0000 (UTC) |
| Complaints-To | groups-abuse@google.com |
| Injection-Info | glegroupsg2000goo.googlegroups.com; posting-host=67.237.93.23; posting-account=494U9QkAAACJUH6jIcyb5E30maZZLsu7 |
| User-Agent | G2/1.0 |
| X-Google-Web-Client | true |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.javascript:11482 |
Show key headers only | View raw
I'm having a problem on my site that seems to ONLY occur when the user has a Blackberry. I have an iPhone and an Android, but no Blackberry, so naturally, I have no way of duplicating the problem.
This is on a classifieds page. The user will select a category from a SELECT menu, then if necessary, a second SELECT menu will pop up for a subcategory.
Further down the page, the user has a series of checkboxes, where they can select to show the listing under multiple sections of the site.
The problem, though, is that with Blackberry users, one of the values of the checkboxes (seemingly random) will come through as the value of the subcategory.
I've tried to duplicate this with IE, FF, Chrome, Safari, Opera, iPhone, and Android, with no luck. The only similarity between the submissions with errors is that the user is using a Blackberry, so I'm guessing that it's either something with the phone, or an error somewhere in the code that's only being picked up by Blackberry.
FWIW, the page "almost" validates via W3.org. The only error that it finds is that I use <p></p> to let the user increase the font size of the page, but it's used within several inline tags. This should be irrelevant for this error, though.
The relevant code is below. Do you guys see a flaw anywhere that could be causing this?
// The JavaScript
//
// this is used later in the script, but I'm
// leaving it here in case it's somehow relevant
var has_subcat = false;
// Set subcategories
function getSubcat(cat) {
var list_cat = new Array();
var show_msg;
// Modified for this post
// The actual script creates several arrays, where the
// list_cat[index] represents a category (like "Autos"),
// and the values represent a subcategory (like "Cars")
list_cat['Autos'] = new Array (
"Cars",
"Trucks, Vans, and SUVs",
"Motorcycles / ATVs",
"Campers / Boats",
"Farm Equipment",
"Parts and Accessories"
);
if (cat && (list_cat[cat].length > 0)) {
has_subcat = true;
show_msg = "<select name='subcat' size='1'>";
show_msg += "<option value=''>Choose a subcategory<\/option>";
for (n=0; n < list_cat[cat].length; n++)
show_msg += "<option value='" + list_cat[cat][n] + "'>"
+ list_cat[cat][n] + "<\/option>";
show_msg += "<\/select>";
}
if (document.getElementById)
document.getElementById('subcategory').innerHTML = show_msg;
else if (document.all)
document.all[subcategory].innerHTML = show_msg;
else if (document.layers) {
document.layers[subcategory].document.write(show_msg);
document.layers[subcategory].document.close();
}
}
// The HTML part of the SELECT menu
<select name="category" size="1" onChange="getSubcat(this.value)">
<option value="">Choose a Category...</option>
// Abbreviated for this post. Several options are
// usually shown here
<option value="Autos">Autos</option>
</select>
<div id="subcategory"></div>
// The HTML part of the checkboxes; roughly 40 of these
// are actually shown
// "option" is intended as a variable here, so the
// live page doesn't actually say "option"
<div style="float:left">
<input type="checkbox" name="more" id="option" value="option">
Option
</div>
Back to comp.lang.javascript | Previous | Next — Next in thread | Find similar | Unroll thread
Blackberry-specific problem Jason C <jwcarlton@gmail.com> - 2012-02-07 20:02 -0800
Re: Blackberry-specific problem Jeff North <jnorthau@yahoo.com.au> - 2012-02-08 16:16 +1100
Re: Blackberry-specific problem Jason C <jwcarlton@gmail.com> - 2012-02-07 21:53 -0800
Re: Blackberry-specific problem Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-02-08 14:43 +0100
csiph-web