Bind button value
See original GitHub issueHtml button element can have name
& value
attributes. If multiple buttons present in the html form the only value of the pressed button will be sent to the server. In this case, multiple buttons work like radio buttons. I imagine it’ll be nice if we’ll be able to do this with Svelte:
<button name="plan" value="free" bind:group={plan}>Free</button>
<button name="plan" value="startup" bind:group={plan}>Startup</button>
<button name="plan" value="enterprise" bind:group={plan}>Enterprise</button>
What do you think about?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:5 (1 by maintainers)
Top Results From Across the Web
angular - how to bind value on button click with [(ngModel)]
i want to bind the value whichever button user selects. Suppose if button1 clicks, it should bind ngmodel i.e updateId with "U-001".
Read more >The "value" binding - Knockout.js
The value binding links the associated DOM element's value with a property on your view model. This is typically useful with form elements...
Read more >Bind Button Value in Form Field - WordPress.org
Am using Elementor Pro, facing issue to get button id in elementor form text field. Here I want when someone click on any...
Read more >Value Binding - Kendo UI MVVM - Documentation
The value binding keeps the value of a DOM element or widget and the value of a View-Model field in sync. When the...
Read more >Form Input Bindings - Vue.js
But sometimes we may want to bind the value to a dynamic property on the current active instance. We can use v-bind to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Looks like a custom
ToggleSwither
component that usually is implemented in UI libraries or by yourself. So it should not be a part of Svelte as it provides only what exists in pure HTMLYou can. If you use a custom component and not native HTML element that doesn’t support it.