Topic: Use rating in a form submit?
Expected behavior I have a form where I will use the rating addon but is it possible to get the rating value from the span id and sendt it when push a submit form button, like input field with a name?
Actual behavior Only a span id
Resources (screenshots, code snippets etc.) https://mdbootstrap.com/plugins/jquery/rating/
Mateusz Łubianka staff answered 5 years ago
Hi @tbsn,
You can use something like the code below:
const doSubmit = (e) => {
const vote_value = $('#root-element).find('.stars.amber-text').length;
...
}
Elements with .amber-text
class - checked stars.
Best,
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Resolved
- User: Free
- Premium support: No
- Technology: MDB jQuery
- MDB Version: 4.14.0
- Device: PC
- Browser: Chrome
- OS: Windows 10
- Provided sample code: No
- Provided link: Yes