Button Style and Cancel action
Could somebody help me with customizing the Button Style and OnClick action of a new CANCEL button. i'm using V3.1.4
I've found various pieces of CSS code but it's not applying it to my new "CANCEL" button, which should be bigger and have a distinct color.
I've only seen that I can adjust the width, but not the height.
This form is a sub-form which is opened from another (main) form I use for navigational purposes using the "Related Items" control.
Once this subform is opened and user decided to cancel then - When new cancel button is clicked - it should exit the sub-form (without saving) and go back to the main form, which i use for navigation.
i'm using the code below "onclick" for SAVE - but can't get it to work when somebody clicks CANCEL
fd.onsubmit(function() {
fd.sourceFormParam('fd_Item_DisplayForm.aspx?ID=' + GetUrlKeyValue('ID'));
return true;
});
Much appreciated!
I've found various pieces of CSS code but it's not applying it to my new "CANCEL" button, which should be bigger and have a distinct color.
I've only seen that I can adjust the width, but not the height.
This form is a sub-form which is opened from another (main) form I use for navigational purposes using the "Related Items" control.
Once this subform is opened and user decided to cancel then - When new cancel button is clicked - it should exit the sub-form (without saving) and go back to the main form, which i use for navigation.
i'm using the code below "onclick" for SAVE - but can't get it to work when somebody clicks CANCEL
fd.onsubmit(function() {
fd.sourceFormParam('fd_Item_DisplayForm.aspx?ID=' + GetUrlKeyValue('ID'));
return true;
});
Much appreciated!
- Nikita Kurguzov
- Posts: 889
- Joined: Mon Jul 03, 2017
Hello!
Yeah, what you describe is possible. The button doesn't have a Height property unlike Width, but there is a Style property where you can put any style specific to the element. It works exactly like HTML style attribute, so you just place everything inside without classes or brackets.
So, the style tag could just contain this line, for example:
The OnClick property can have this piece of code to redirect users to Display Form without saving changes, just make sure to save Display Form in Forms Designer first:
Yeah, what you describe is possible. The button doesn't have a Height property unlike Width, but there is a Style property where you can put any style specific to the element. It works exactly like HTML style attribute, so you just place everything inside without classes or brackets.
So, the style tag could just contain this line, for example:
Code: Select all
height: 250px;
Code: Select all
var FormID = GetUrlKeyValue("ID");
fd.openForm('fd_Item_DisplayForm.aspx', {ID: FormID});
Cheers
Got it to work - Thanks! Great Support.
For those that want to follow this solution, please note that I clicked the "BUTTONS" icon to add the regular SAVE and CANCEL buttons at the bottom.
Then you have to add a new "Button" and call it "cancel" and add the code to the Onclick field. (fd_Item can also be fd_task depending on what type of list you use).
Then you can delete the original Cancel button. Hope it helps.
For those that want to follow this solution, please note that I clicked the "BUTTONS" icon to add the regular SAVE and CANCEL buttons at the bottom.
Then you have to add a new "Button" and call it "cancel" and add the code to the Onclick field. (fd_Item can also be fd_task depending on what type of list you use).
Then you can delete the original Cancel button. Hope it helps.
-
- Information
-
Who is online
Users browsing this forum: No registered users and 20 guests