I am looking to align a custom button next to the built in submit button.
Is this something that could be done within the new Forms Designer? Thanks.
I am looking to align a custom button next to the built in submit button.
Is this something that could be done within the new Forms Designer? Thanks.
Hi Tommy,
The User task allows to add more buttons than the default three buttons, is there any special needs you need this custom button using html field? And I don't think you can align your custom button with submit button easily in new form designer.
Hi Zhiyong,
I was looking to add a custom button function, to reset the fields within a form. Also, by chance do you happen to know the onclick button function for submit? Thank you.
Hi Tommy,
You can bind a onclick event to the custom button like below. But the javascript functionality is limited, you'd better use the built-in LFForms object function that's designed for new form designer.
<button onclick="console.log('Clicked');">Click Me</button>
EDIT TO ADD: When I wrote this - I hadn't noticed your part of the post asking about doing it on the new/modern designer. Unfortunately this won't work in the new/modern designer, and there isn't a way to re-write it so that it would work, because Javascript in the new/modern designer runs within a sandboxed iFrame and doesn't have direct access to the fields and structure of the form that would be needed to move components around like that. Sorry.
----------------------------
This was tested on the Classic Designer (it won't work on Modern Designer) in Version 11.0.2307.40547.
I added the following to the form using the Custom HTML field element:
<input type="button" id="clearFieldsButton" class="action-btn" value="Clear Fields">
That action-btn class should get the button formatted the same way as the Submit button.
Then I added this Javascript to the form:
$(document).ready(function() { //Hide the custom HTML element that contains the Clear Fields button. $('.clearFieldsButton').closest('li').hide(); //Move the clear fields button into the btn-wrapper div element. $('.btn-wrapper').append($('#clearFieldsButton')); //Process the clear fields button click. $('.clearFieldsButton').click(function() { alert('Clear fields button was clicked!'); }); });
End result is that the Clear Fields button is next to the submit button, but still functions via the Javascript code included on the form: