Prevent button to submit form

I need to add additional buttons inside  a grid EditMode.Dialog template, for example: a button for "Shipping Address same as Customer" . The problem is when the button is clicked it submits the form, which is not what it is supposed to do. How can it be prevented ?   

<div class="form-group">
    <label class="col-sm-6">SHIPPING INFORMATION</label>
    <div class="col-sm-6">
        <SfButton  @onclick="CopyAddressFromCustomer">Same as Customer</SfButton>
    </div>
</div>


@code{

      protected void CopyAddressFromCustomer()
        {
              // code to repeat address.....
        }

}

1 Reply 1 reply marked as answer

AD Arunkumar Devendiran Syncfusion Team June 17, 2020 02:09 PM UTC

Hi Ben Junior, 
 
Thank you for contacting Syncfusion support. 
 
We have checked your reported issue and we suggest you to set the Type as button to resolve your reported issue. Please refer the below code snippet. 
 
Code snippet: 
<SfButton Type="button" @onclick="CopyAddressFromCustomer">Same as Customer</SfButton> 
 
Please get back to us with more information if we misunderstood your requirement or need further assistance.  
 
Regards, 
Arunkumar D 


Marked as answer
Loader.
Up arrow icon