I have not find a way to delete undesired fields in application forms, is there an easy way to do this?
Thank you
I have not find a way to delete undesired fields in application forms, is there an easy way to do this?
Thank you
gbastida, at current there are no option to disable fields in the application form. I know it is a long form, and these are options are something we would consider. What is it that you don’t need? Other options include removing the fields in your own install (which will need to be redone every time you upgrade), or switching to the Public Registration mode, which uses a very stripped down form (that might be too simple for your needs, I am not sure). You can enable this form at Admin > User Admin in the main menu followed by Public Registration settings in the module menu. Hope this helps! Ross.
I would like to, for instance, hide all the parents related fields, as well as have school fields not required. How can I achieve this?
Thanks !!!
javiers, at the moment there is not much we can do to help directly, as we are working hard on some other, very involved, behind-the-scenes changes for Gibbon v14. If you want to play around with this, I would look at /modules/Students/applicationForm.php and applicationFormProcess.php and locate the parts of the code that are rendering and processing the fields you wish to edit. You could then delete the code, and test to see if it still works. Hope this helps. Ross.
That’s ok! Thanks for the help anyways!
Kind regards
Hi Javiers
I know your post is a long time ago but did you manage to achieve this as I would like to do the same thing and remove a number of fields that we will not use. Was it just a matter of commenting out entries in the two mentioned php files and what if it was a required entry in the database?
As an example i would like to remove the ‘First Name’ field (compulsory) from the application form as we don’t have a concept of first name in Burmese we just have a name and not even spaces between words! so for example ‘Nay Min Htun’ is entered as nayminhtun in Burmese obviously using the Burmese font ေနမင်းထွန်း
Any advice greatly appreciated from any contributors!
Graham
Hello gtb88,
i had a similar problem:
https://ask.gibbonedu.org/discussion/comment/6238
“Rather than deleting (or un-requiring) a field, you can replace it with a hidden field that fills something like ‘N/A’ into the field in the background. This could let you remove and tweak the front-end of the application without breaking the back-end.”
Thank you ub123 for pointing me at the old post from Sandra i think i can move forward with that. It is appreciated.
cheers
Graham
Hi All
I have been removing Student Application Form fields nicely and replacing them with Default values as appropriate and modelled by Sandra and ub123 and all is working fine. However my php skills are lacking with respect to the parent fields that I would like to enter default values into. It is due to the clever code that adds a digit 1 or digit 2 to the parent records. So as an example, what is wrong with this?
//$row = $form->addRow()->setClass("parentSection{$i}");
//$row->addLabel("parent{$i}languageFirst", __('First Language'));
//$row->addSelectLanguage("parent{$i}languageFirst")->placeholder()->loadFrom($application);
$form->addHiddenValue("parent{$i}languageFirst", 'Myanmar');
The first three commented out rows are the original working code and the fourth row is not working as it doesn’t enter the text ‘Myanmar’ into the submitted application form. It is to do with the $i I think. The fourth row works perfectly in other situations where there isn’t a $i to cope with!
Any guidance greatly appreciated
Graham
Hi Graham,
Your example is looking good, from what I can see the fourth row should work as long as it is inside the same loop scope { } as the commented out code (which is where the $i comes from). When you’re observing that it is not working, is the value missing from the database gibbonApplicationForm table, or just when you view the submitted form in Manage Applications?
Hi Sandra and thanks for your prompt reply
It is missing from manage applications form, if i add ‘Myanmar’ manually at the manage applications stage then it creates the parent record fine when i push the accept button, if i don’t add ‘Myanmar’ then the parent record creation fails at the accept button stage
Hmm, are you able to share your modified applicationForm.php file? The snippet you shared looked okay, perhaps the rest of the code may give a clue.
There you go Sandra, i have renamed it .txt as i couldn’t seem to attach a .php in the parent section the code
Thanks again
Hmmm. I’ve tested the code you’ve shared and there’s currently a database error: SQLSTATE[23000]: Integrity constraint violation: 1048 Column ‘languageHomeSecondary’ cannot be null. It looks like this is due to removing fields without adding a hidden value for them. Perhaps check over your code and be sure to add fallback values, even an empty space, for all fields you comment out.
Thanks Sandra, I will have a look at that, i am surprised though as languageHomeSecondary isn’t a required field so I commented it out in the applicationForm.php and the applicationFormProcess.php and that process worked for all of the other rows that I commented out
cheers
Graham