WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: continuing JavaScript issue

for

From: Stanzel, Susan - FSA, Kansas City, MO
Date: Jun 26, 2013 12:46PM


I have fixed the label problems. However, the problem still exists. It appears that after I make a state selection from the list of states that JAWS gets confused when I am doing a selection of the county. It appears JavaScript is making changes to the page and JAWS thinks it has the same page and reads the county selection label for each subsequent form field.

:


1. <tr>

2.

3. <td><label for="stateSelection"><font color = "red">*</font>State</label>:</td>

4.

5. <td><select name="stateFsaCode" onchange="resetCountyList();" id="stateSelection"><option value="">-- Select State --</option>

6.

7.

8.

9. <option value="01">Alabama</option>

10.

11. <option value="04">Arizona</option>

12.

13. <option value="05">Arkansas</option>

14.

15. <option value="06">California</option>

16.

17. <option value="12">Florida</option>

18.

19. <option value="13">Georgia</option>

20.

21. <option value="20">Kansas</option>

22.

23. <option value="22">Louisiana</option>

24.

25. <option value="28">Mississippi</option>

26.

27. <option value="29">Missouri</option>

28.

29. <option value="31">Nebraska</option>

30.

31. <option value="35" selected="selected">New Mexico</option>

32.

33. <option value="37">North Carolina</option>

34.

35. <option value="40">Oklahoma</option>

36.

37. <option value="45">South Carolina</option>

38.

39. <option value="47">Tennessee</option>

40.

41. <option value="48">Texas</option>

42.

43. <option value="51">Virginia</option></select></td>

44.

45.

46.

47. <td><label for="countySelection"><font color = "red">*</font>County</label>:</td>

48.

49. <td><select name="countyFsaCode" onfocus="fillCountyList();" id="countySelection"><option value="">-- Select County --</option>

50.

51.

52.

53. <option value="001">Bernalillo</option>

54.

55. <option value="003">Catron</option>

56.

57. <option value="005">Chaves</option>

58.

59. <option value="006">Cibola</option>

60.

61. <option value="007">Colfax</option>

62.

63. <option value="009">Curry</option>

64.

65. <option value="011">De Baca</option>

66.

67. <option value="013">Dona Ana</option>

68.

69. <option value="015">Eddy</option>

70.

71. <option value="017">Grant</option>

72.

73. <option value="019">Guadalupe</option>

74.

75. <option value="021">Harding</option>

76.

77. <option value="023">Hidalgo</option>

78.

79. <option value="025">Lea</option>

80.

81. <option value="027">Lincoln</option>

82.

83. <option value="028">Los Alamos</option>

84.

85. <option value="029">Luna</option>

86.

87. <option value="031">McKinley</option>

88.

89. <option value="033">Mora</option>

90.

91. <option value="035">Otero</option>

92.

93. <option value="037">Quay</option>

94.

95. <option value="039">Rio Arriba</option>

96.

97. <option value="041">Roosevelt</option>

98.

99. <option value="045">San Juan</option>

100.

101. <option value="047">San Miguel</option>

102.

103. <option value="043">Sandoval</option>

104.

105. <option value="049">Santa Fe</option>

106.

107. <option value="051">Sierra</option>

108.

109. <option value="053">Socorro</option>

110.

111. <option value="055">Taos</option>

112.

113. <option value="057">Torrance</option>

114.

115. <option value="059">Union</option>

116.

117. <option value="061">Valencia</option></select></td>

118.

119. </tr>

120.
This is the rendered html from the jsp

This is the JavaScript:

<script type="text/javascript">

var prevStateIndex = document.forms[0].elements['stateFsaCode'].selectedIndex;

function resetCountyList()
{
var selectObj = document.forms[0].elements['countyFsaCode'];

selectObj.selectedIndex = 0;
}

function fillCountyList()
{
if(document.forms[0].elements['stateFsaCode'].selectedIndex == prevStateIndex)
{
return;
}

var selectObj = document.forms[0].elements['countyFsaCode'];

selectObj.options.length = 0;
selectObj.options[0] = new Option(' Loading... ', '');
selectObj.selectedIndex = 0;

document.forms[0].submit();
}





This electronic message contains information generated by the USDA solely for the intended recipients. Any unauthorized interception of this message or the use or disclosure of the information it contains may violate the law and subject the violator to civil or criminal penalties. If you believe you have received this message in error, please notify the sender and delete the email immediately.