1

The code below is taken as example from a larger classic asp module.

<SELECT Name="numSelect">
    <OPTION Value="NONE" selected>-- choose a number below --</OPTION>
    <OPTION Value=1>1</OPTION>
    <OPTION Value=2>2</OPTION>
    <OPTION Value=3>3</OPTION>
    <OPTION Value=4>4</OPTION>
</SELECT>
  1. the code works fine in desktop browsers, IE, Chrome, Firefox and Opera. The box is open to show the options, ready to click on.
  2. the code, however, does not work in Android mobile browsers, Opera-mobile, Chrome, Firefox nor the built in Samsung Internet browser. The picklist does open in those browsers when the down-arrow is clicked. There is one difference to this. The Puffin browser for Android "does" the option box correctly (i.e. it is open).
  3. the code also does not work in iPhone, nor iPad browser Safari. Although the first option is displayed, the list is not open. The picklist opens when the down-arrow is clicked.

I thought it may have to do with differences between HTML5 and earlier versions, but I can find no such references. There is no different browser behavior whether the code is sent via the ASP server, or whether it is sent as an .html file.

My question is 2-fold.

  1. what may be the difference between the browsers? I recognize that this is a loaded question. This may not be answerable, but if possible a short explanation.
  2. is there a different way to handle the options pickbox (combobox that shows the list without having to click the down-arrow) that would work on the Android? I am not looking for detailed code; but would welcome a suggestion.

Thanks for any help and/or enlightenment.

Edit: As suggested below, added quotes to attributes. Results are the same. Desktop browsers show the select/option correctly as an open box, but Android browsers do not show as open box, with exception of the Puffin browser that shows the open box correctly. Safari on iPhone and iPad also do not show the open box.

kdsdata
  • 13
  • 5

1 Answers1

0

You problem can be related to missing quotes in attributes values, like value.

There's a question about this: html-attribute-with-without-quotes

W3C specification says:

All attribute values must be quoted, even those which appear to be numeric.

https://www.w3.org/TR/xhtml1/#h-4.4

So, your code could be like this:

<SELECT name="numSelect">
    <OPTION value="NONE" selected>-- choose a number below --</OPTION>
    <OPTION value="1">1</OPTION>
    <OPTION value="2">2</OPTION>
    <OPTION Value="3">3</OPTION>
    <OPTION value="4">4</OPTION>
</SELECT>

Browsers can handle this differently and can be the issue, and adding the quotes, your code will be following the W3C specification

Ricardo Pontual
  • 3,749
  • 3
  • 28
  • 43
  • 1
    I thought we had a winner, but unfortunately I get the same results with the quotes, as without the quotes (edited my question to say that). As indicated on W3 I will change my programming style to use quotes, but it's not yet the answer to my problem. Thank you to your submit, to clean up my programming. – kdsdata Apr 24 '18 at 18:59