button apply between elements or order button apply

good afternoon.
Is it possible to create a button to apply within a form ... between the elements of the form?
I am very interested that the form is not recorded directly ... first they should apply before recording.


if it is not possible..?

Can you change the order of the record and apply buttons?
attached two images.
thank you
Alberto
 

Attachments

  • button order.jpg
    button order.jpg
    200.4 KB · Views: 69
  • button.png
    button.png
    2.4 KB · Views: 74
Hello again,
in case it has not been clear ...
I would like to create an "apply" button that was a "button element"
and it was between the elements of the form ...
Thank you!
attached image

Alberto
 

Attachments

  • button element apply.jpg
    button element apply.jpg
    21.6 KB · Views: 67
Yes - everything is possible in IT. Just depends how much effort you want to put in.

My suggestion would be to hide the standard apply button using CSS and create a Fabrik Button element and then use JS to simulate a click on the real Apply button when the Fabrik element button is clicked.

But other people might have other suggestions.
 
I seem to recall answering this question before. A search of the forums for suitable keywords might find the answer.

-- hugh
 
very good
thanks for the ideas.
I have seen that on the screen that I attached, in "button type" it says:
"sets the type attribute on the button, to optionally make this button apply or submit the form".

my question is...
can you optionally do "apply" button?

thank you ... to see if I find a solution ...
alberto
 

Attachments

  • button apply optionally.jpg
    button apply optionally.jpg
    57.7 KB · Views: 71
If I were trying to work out what to do I would set this button type to "submit" and decide whether the element "submit" button was doing what I wanted it to.

If not, then I would be looking to add more options to the button element as follows:

a. Enable all the form buttons relating to saving the record i.e. apply/save/submit and review the HTML code for the form button that does what you want
b. Work out how to change the button element to add a new option to the button-type dropdown and adjusting the layout to produce the appropriate HTML.
c. Submit a PR with these changes so that it is included in Fabrik in the future and I won't have to keep reapplying my changes after a Fabrik update.
 
I observe that in input type there are 3 options.
button ---> does nothing.
submit ---> which records form
clear ---> that cleans the form.

I do not know how to see the "apply" option.

with respect to sections a) and b) ...
I wish I could do it ... but I have my limitations of code and language ... and I do not even know where to start ...
I will continue thinking and looking for the wifi .. to see if I could find the solution ...

I can think of this:
would it be possible to create a javascript in javascript code of the button element that would call the function "apply" when doing "click"?
or am I saying nonsense?

thanks for everything...
 
The use of the word apply is only as a synonym of submit. Without testing it I don't know where that takes you.

So, do as I suggest and see what happens when you set "submit" as the button type - and if it doesn't do what you want I will try to help you with a solution.
 
good.
with the "submit" type option of the button element ... it records the form ... and the completed fields disappear ... that is, it makes the "record or send form" function ...
I understand that if I did "apply" the fields would remain fulfilled on the screen.
attached screen.

without words to thank you for your attention and patience.
Thank you!
 

Attachments

  • buttonsubmitred.jpg
    buttonsubmitred.jpg
    57.5 KB · Views: 65
I need more information:

1. What is the URL for the form.
2. What is the URL after clicking the button.
3. If you enable the Apply and Save buttons in the form, what happens when you click those.
4. Please save the HTML of the form with Apply and Save buttons showing and attach the file here. (You may need to rename it as a txt file).
 
I need more information:

1. What is the URL for the form.
2. What is the URL after clicking the button.
3. If you enable the Apply and Save buttons in the form, what happens when you click those.
4. Please save the HTML of the form with Apply and Save buttons showing and attach the file here. (You may need to rename it as a txt file).

Hello,
I send you the information you asked for.
I have created a user so you can access ... if you do not need it, tell me and I disable it.

do you think it would be possible to create a typo button element "apply" and that it works as "apply" :(
If you need any more information, tell me and I'll send it to you.
thanks for your time!!:):)
Note: if you can use crhome better ... with internet explorer11 no button works. I have to look for one of these days, for the wiki ... the possible solution


1. https://www.gonline.cat/index.php/registre-sol-licitant
2. https://www.gronline.cat/index.php/component/users/?view=login
Attached screen file called ?screen after applying element button apply section2.jpg?
3. If I enable and click save button, it saves it correctly and the destination url is the samehttps://www.gronline.cat/index.php/component/users/?view=login
that the "apply" button that I created in button element.
If I enable and click the "apply" button, it saves it correctly ... keeping on screen the values that have been recorded ... and the url destination is this: https://www.gonline.cat/index.php/component/fabrik/form/33/20
attached screen file called?applysupportforum.jpg?
4. Ok. The file is called code-form-apply-save.txt
I give you a username and password:
sophist | fabrikforumok
 
Last edited:
Thank you - that is enough for me to think about how easy / hard it would be do do it.

It might be possible to build this properly into the button element - but that would be time consuming and although some of the building blocks already exist (like adding a submitbutton function to form javascript), it would not necessarily be straight forward (for example, submitbutton relies on the button id being e.g. "cancel" and you can't do this on a button element).

I think the easiest thing to do would be to take off the Submit function from the button and use Javascript to mock and event of clicking the Apply button.

So this means that you have to have the apply button on your form - even if you hide it with CSS.

Off the top of my head (which means I haven't tested this and it may be just the right concept and code which doesn't work), edit the Button element, set the Button Type back to Button, and then add a Javascript event as follows:

Event: Click
Javascript code:
[javascript]var btn = document.getElement('#apply');
this.doSubmit(new Event.Mock(btn, 'click'), btn)[/javascript]

Let us know how you get on.
 
very good ...
the code ... it does not work ... I'll look to see if I find information.

and with respect to the first comment ... of siular button "record" and leave button apply ... it could be an option ... although I would be interested that the "apply" button was in front of the "record" button.
attached code image ...

Thank you very much really.
Alberto
Thank you - that is enough for me to think about how easy / hard it would be do do it.

It might be possible to build this properly into the button element - but that would be time consuming and although some of the building blocks already exist (like adding a submitbutton function to form javascript), it would not necessarily be straight forward (for example, submitbutton relies on the button id being e.g. "cancel" and you can't do this on a button element).

I think the easiest thing to do would be to take off the Submit function from the button and use Javascript to mock and event of clicking the Apply button.

So this means that you have to have the apply button on your form - even if you hide it with CSS.

Off the top of my head (which means I haven't tested this and it may be just the right concept and code which doesn't work), edit the Button element, set the Button Type back to Button, and then add a Javascript event as follows:

Event: Click
Javascript code:
[javascript]var btn = document.getElement('#apply');
this.doSubmit(new Event.Mock(btn, 'click'), btn)[/javascript]

Let us know how you get on.

very good,
after giving it many laps ...
I think the best option within the form, would be to change the order of the 2 buttons ... because I understand that first the "apply" button must be and then the "save" button
I would like it to be as indicated in the green image ...
Should I modify some CSS ... if so? What file should I modify?
I would try to do it with dreamweaver, at the editing level.
upload_2018-2-7_17-24-50.png

thank you
 

Attachments

  • codejavascript.png
    codejavascript.png
    132.9 KB · Views: 23
  • upload_2018-2-7_17-23-47.png
    upload_2018-2-7_17-23-47.png
    18.1 KB · Views: 26
You can change how the form buttons are displayed if you create an override for the appropriate template. See the wiki / forum for examples on how to do it. The file I think you will need to change is /components/com_fabrik/views/form/view.base.php

(However, I would counsel you to accept most of the default ways that Fabrik does stuff, otherwise you will get bogged down in tweaking the layout rather than delivering functionality. One of the trade-offs you make when you choose Fabrik as a development environment is that you get a lot of functionality and an ease of development in return for accepting the Fabrik way of doing things.)
 
No, you wouldn't need to override the view itself, just the default_actions.php in the template.

You could either copy the ./components/com_fabrik/views/form/tmpl/bootstrap folder entirely, to create a custom template you use just for that form (see wiki), or if you want to override the button layout for all your forms, use a template override ...

http://www.fabrikar.com/forums/index.php?wiki/form-and-details-templates/#template-overrides

... by copying ...

components/com_fabrik/views/form/tmpl/bootstrap/default_actions.php

... to ...

templates/<your site template>/html/com_fabrik/form/bootstrap/default_actions.php

... and modifying this part ...

Code:
            <div class="<?php echo FabrikHelperHTML::getGridSpan(4); ?>">
                <div class="btn-group">
                    <?php
                    echo $form->submitButton . ' ';
                    echo $form->applyButton . ' ';
                    echo $form->copyButton;
                    ?>
                </div>
            </div>

... to order / lay them out how you want. You could modify the surrounding div's, change the order they are echo'ed in, etc.

-- hugh
 
Yes - but when you do that, then you become responsible for maintaining it. So if I were to write code that changed the way (say) view.html.php and default_actions.php worked then the new functionality wouldn't get carried across to the override file. So to use a real example of my PR for class support for buttons - you might find that classes made it to the back end settings page, but then didn't display and you would be left scratching your head wondering why because you had forgotten that you had implemented the default_actions.php override.

So IMO my comment stands - try as much as possible to stick with the way Fabrik does things and only change them with overrides if absolutely necessary.
 
Actually that's not a great example because the classes are implemented in view.html.php or in a layout file - but I still think the principle holds true.
 
Very good days,
it's interesting, to know what can be done ...
and makes it possible to learn more about the interiors of fabrik ...
nevertheless ... I will follow the advice of sophist ... and I will give priority to other doubts and difficulties that I have ...
I greatly appreciate the comments and the wisdom.
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top