Clear Choice Field on Edit Form

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
User avatar
TonyDuke
Posts: 71
Joined: Mon Sep 11, 2017

06 Jun 2018

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

Code: Select all

fd.field('Intruder_x0020_Signalling_x0020_').value('');
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

User avatar
Nikita Kurguzov
Posts: 889
Joined: Mon Jul 03, 2017

08 Jun 2018

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.
Cheers

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 12 guests