Hello,
I have a Create Entity Form for one of the entity, On that form, I can see the Submit button to insert the records into the entity, Along the line I also need the Cancel button to cancel the form, However, I have a * sign on the top right section of the form to cancel the form.
Please suggest any solution to this.
Regards,
Solved! Go to Solution.
You can achieve that via JS/jQuery
You can add the below code into the Custom JavaScript section on your Entity Form
$(document).ready(function(){
AddCloseButton();
});
function AddCloseButton(){
var button ="<input type='button' class='btn btn-warning' value='Close' onclick='parent.$(\".form-close\").eq(0).click();'/>"
$("#EntityFormControl_EntityFormView").next().append(button);
};
------------
If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
Power Apps Portals Super User
hi
can you add a snapshot with the issue and what you need?
is your entity form showing as a pop-up within an entity list?
------------
If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
Power Apps Portals Super User
Hi @OliverRodrigues ,
Let's say I have a web page in the power apps portal, and I have one form component on that web page, as shown in the screenshot below,
Besides the Submit button in the form component, I need the 'Cancel' button to reload the same page.
Please add comments on this.
You can achieve that via JS/jQuery
You can add the below code into the Custom JavaScript section on your Entity Form
$(document).ready(function(){
AddCloseButton();
});
function AddCloseButton(){
var button ="<input type='button' class='btn btn-warning' value='Close' onclick='parent.$(\".form-close\").eq(0).click();'/>"
$("#EntityFormControl_EntityFormView").next().append(button);
};
------------
If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
Power Apps Portals Super User
@praneshJ did that solution work ? if yes can you mark as answer so people can refer to it in the future?
thanks
Power Apps Portals Super User
Hi @OliverRodrigues ,
The button is getting displayed on the popup as expected, but on click of that button popup window is not getting closed using the given code in above solution.
Any alternatives to close the popup on click of this close button, would be really helpful.
Regards,
In my code I am finding the main close button "x" via class: form-close
inspect your element and see if you have the same class there, if it is a different one you can replace in the code
Power Apps Portals Super User
Hi @OliverRodrigues ,
In my code I am finding the main close button "x" via class: close,
and i have replaced it with the close in my code now, please check the below screen shot.
but it still not getting closed.
when I checked replacing close with form-close that in the browser, its working fine then.
Please suggest any alternatives or let me know how can I replace the class for that "x" button ?
I am really thankful for your quick replies.
Regards,
is it working for you with the .close class?
whatever class works for you is fine, there is no need to change the x button
Power Apps Portals Super User
User | Count |
---|---|
9 | |
6 | |
6 | |
4 | |
2 |
User | Count |
---|---|
20 | |
18 | |
16 | |
13 | |
4 |