SitePoint Sponsor |
|
User Tag List
Results 1 to 9 of 9
Thread: No Text Entry via Opera
-
Sep 28, 2006, 08:45 #1
- Join Date
- Jun 2004
- Location
- Harrisburg
- Posts
- 65
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
No Text Entry via Opera
I have a few form elements that when viewed in Opera do not allow entry of data. But some do. Any reason why this is happening? The first input field doesn't allow any input in Opera, but the second input field does.
HTML Code:<input id="_id163:txtinzip1" type="text" name="_id163:txtinzip1" class="inputFixed" maxlength="5" onkeypress="return numbersonly(this,event)" size="5" /> <span id="_id163:txtoutHyphen3"> - </span> <input id="_id163:txtinzip2" type="text" name="_id163:txtinzip2" class="inputFixed" maxlength="4" onkeypress="return numbersonly(this,event)" size="4" />
HTML Code:// numbers else if ((("0123456789").indexOf(keychar) > -1)) return true; else return false; } function lettersonly(e) { var key; var keychar; if (window.event) key = window.event.keyCode; else if (e) key = e.which; else return true; keychar = String.fromCharCode(key); keychar = keychar.toLowerCase();
-
Sep 28, 2006, 09:16 #2
- Join Date
- Nov 2004
- Location
- Ankh-Morpork
- Posts
- 12,158
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I don't know if that's the cause of the problem, but your ID and NAME values are invalid. According to the spec:
ID and NAME tokens must begin with a letter ([A-Za-z]and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".").
Thus you cannot start those identifiers with underscore characters.Birnam wood is come to Dunsinane
-
Sep 28, 2006, 09:40 #3
- Join Date
- Apr 2002
- Location
- A Maze of Twisty Little Passages
- Posts
- 6,316
- Mentioned
- 60 Post(s)
- Tagged
- 0 Thread(s)
I was going to say the nearly same thing about the ID - if you were using HTML that is.
-
Sep 28, 2006, 10:01 #4
- Join Date
- Jun 2004
- Location
- Harrisburg
- Posts
- 65
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
This is actually in a java page (.jsf). The page validates with monir errors and warnings, none of which are related to the underscore. Even so, why would the numeric entry work for the second input field but not the first one?
-
Sep 28, 2006, 22:39 #5
- Join Date
- Nov 2004
- Location
- Ankh-Morpork
- Posts
- 12,158
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
The validator won't catch this sort of error, because it's based on the DTD, and DTDs cannot express these constraints.
I'm not sure that this is the cause of your problem, but it's invalid at any rate and you should fix it. With invalid code, you have no right to expect browsers to do what you want. (They often don't even if you do have valid code, but that's another issue.)
Birnam wood is come to Dunsinane
-
Sep 29, 2006, 07:03 #6
- Join Date
- Apr 2002
- Location
- A Maze of Twisty Little Passages
- Posts
- 6,316
- Mentioned
- 60 Post(s)
- Tagged
- 0 Thread(s)
Off Topic:
Mr T. Note that the collection of legal values in XML 1.0 Section 2.3, production 5 is much larger than that permitted to be used in the ID and NAME types defined in HTML 4.
Maybe we need to see the rest of the Transitional code sample?
-
Sep 29, 2006, 08:42 #7
- Join Date
- Jun 2004
- Location
- Harrisburg
- Posts
- 65
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I wish I understood how the html I create gets converted to jsf. My task is to create the html pages which then get converted by java programmers into jsf files. My html is always validated, but I can't speak for the jsf files.
My thoughts are that it's something to do with the javascript. I believe it was included so that the user can only enter numeric characters. But I believe we have an implimentation for both IE and Mozilla. And maybe Opera handles this differently?
-
Sep 29, 2006, 08:44 #8
- Join Date
- Dec 2003
- Location
- Cheltenham, United Kingdom
- Posts
- 692
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Have you tried removing the js to see if it's causing the issue?
Olly Hodgson
thinkdrastic.net
-
Oct 4, 2006, 06:16 #9
- Join Date
- Jun 2004
- Location
- Harrisburg
- Posts
- 65
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I haven't removed the js. Other form fields that also use the js work fine.
Bookmarks