We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How do you achieve efficiently assigning the selected value to a dynamically loaded dropdown select element while looping in Template7?
The text was updated successfully, but these errors were encountered:
I need too =/
Sorry, something went wrong.
Resolved!!
.js file Template7.registerHelper('select', function (value, options) { var $el = $('<select />').html(options.fn(this)); $el.find('[value="' + value + '"]').attr({ 'selected': 'selected' }); return $el.html(); });
Template7.registerHelper('select', function (value, options) { var $el = $('<select />').html(options.fn(this)); $el.find('[value="' + value + '"]').attr({ 'selected': 'selected' }); return $el.html(); });
.html file
<select name="uf"> {{#select cliente.uf}} <option value="0" selected>Selecione</option> <option value="AC">Acre</option> <option value="AL">Alagoas</option> <option value="PB">Pernanbuco</option> ... </select>
No branches or pull requests
How do you achieve efficiently assigning the selected value to a dynamically loaded dropdown select element while looping in Template7?
The text was updated successfully, but these errors were encountered: