Clear Choice Field on Edit Form
Good Morning,
I'm fairly sure this is a simple one and I'm just missing a small step, I have a number of edit forms with single choice fields (drop downs), these are not required fields but can be set by the user as additional information. However under certain circumstances I need these fields to be set to back to "null", I am happy to do this using JavaScript and am using the following code
On the form itself this clears the value from the field, however on save what actually happens is the choice is selected automatically to the first choice in the selection list. (please note that the default choice is set to "null")
If I edit the list item in datasheet view I can clear these fields, can you please explain how to do this using JavaScript?
The second part of this is that there may be circumstances where I wish the user to be able to manually set the field to blank, but I am aware a blank choice cannot be added as a selection, what would you suggest as a way around this? Could I hijack the field selections and add the blank choice in on load of the form for the user to pick from using JavaScript, if so how would I do this?
Thanks
I'm fairly sure this is a simple one and I'm just missing a small step, I have a number of edit forms with single choice fields (drop downs), these are not required fields but can be set by the user as additional information. However under certain circumstances I need these fields to be set to back to "null", I am happy to do this using JavaScript and am using the following code
Code: Select all
fd.field('Intruder_x0020_Signalling_x0020_').value('');
If I edit the list item in datasheet view I can clear these fields, can you please explain how to do this using JavaScript?
The second part of this is that there may be circumstances where I wish the user to be able to manually set the field to blank, but I am aware a blank choice cannot be added as a selection, what would you suggest as a way around this? Could I hijack the field selections and add the blank choice in on load of the form for the user to pick from using JavaScript, if so how would I do this?
Thanks
- Nikita Kurguzov
- Posts: 889
- Joined: Mon Jul 03, 2017
Dear Tony,
Unfortunately, this does not seem possible to do or at least very tricky to actually implement. The best thing we can recommend for now is adding a new choice value, which will serve as fallback default value, such as NULL, or "Please, choose an item", or something along these lines.
Unfortunately, this does not seem possible to do or at least very tricky to actually implement. The best thing we can recommend for now is adding a new choice value, which will serve as fallback default value, such as NULL, or "Please, choose an item", or something along these lines.
Cheers
-
- Information
-
Who is online
Users browsing this forum: No registered users and 20 guests