Skip to content

Conversation

@eiling
Copy link

@eiling eiling commented May 31, 2022

Add an option to include tooltips using the 'title' attribute

The tooltip option value can be either 'value' or 'text' and corresponds to which attribute of the option will be used for the tooltip.

Examples:

<select name="languagejs">
  <option value="ru">Russian</option>
  <option value="fr">French</option>
  <option value="pt">Portuguese</option>
  <option value="zh">Chinese</option>
</select>
<script>
cuteform($('select[name=languagejs]'), {
  'tooltip': 'value',  // results in title="ru"
  'images': {
    'ru': 'images/ru.png',
    'fr': 'images/fr.png',
    'pt': 'images/pt.png',
    'zh': 'images/zh.png',
  }
});
</script>
<select name="languagejs">
  <option value="ru">Russian</option>
  <option value="fr">French</option>
  <option value="pt">Portuguese</option>
  <option value="zh">Chinese</option>
</select>
<script>
cuteform($('select[name=languagejs]'), {
  'tooltip': 'text',  // results in title="Russian"
  'images': {
    'ru': 'images/ru.png',
    'fr': 'images/fr.png',
    'pt': 'images/pt.png',
    'zh': 'images/zh.png',
  }
});
</script>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant