Hi Chris,
I made an example regarding how you can set a rating fields' value to zero with the use of an HTML button.
Firstly, drag an instructional text widget onto the body of your form then edit it. Click the HTML option located at the bottom of the text area to switch over to HTML editing mode. This is where we'll create a button as this will ensure that we have full control over what the button does unlike the Sitefinity submit button.
<button id="btnReset" type="button">Reset Rating Field to Zero</button>
You may also add any number of classes to this button to ensure that its style is inline with the rest of your website.
Next, drag a JavaScript code block onto the body of your form and open it, then add this code to the code section:
$(window).load(
$("#btnReset").click(function() {
findControl(".CrmRatingField_C007").set_value(0);
})
);
This function will reset the rating field's value to zero when you click on the button. Make sure to check the 'Before the closing body tag' option in the JavaScript editor to ensure that JQuery has loaded before this function is run.
Please let us know if you have any more questions or concerns.
Kind Regards,
Chris Rooney.
Last modified on 04 Apr 2016 19:04 by Missing user