3

I have a P&T Dropdown that has a default value of " : Select one..." and once you select and submit any other option than that default... there seems to be no way to reset that fields value back to the default.

Consider I have Field#1 "Are you Coming?" and the another Field#2 "What you eating?". When I use selects Field#1=Yes then they get to submit field#2 as "Fish". However, they may later come back and resubmit as Field#1=No in which case I reset Field#2 (via JS) to " : Select one..." and set it to "disabled" and submit. This however does not reset the field.

Figure 1

1

This doesn't sound like it's doing anything wrong, but just what it's told to do. If you've made this a required field and you're default value is set to tell them to choose an option then once they've chosen and submitted that field then has a value. The only way to change it would be to give it another value but your default is just telling them to select (it's a null value).

It's just like the title field of an entry in the publish page being required. Once you've submitted that entry it's saved with that title value. If you then edit that entry and and try to submit with an empty title field (the default) then it will return an error telling you to give that entry a title.

For the dropdown field, why don't you set a default to either yes and no rather than put in a default value which is null (i.e. it's akin to the empty title field example).

| improve this answer | |
0

Can you share how you had setup the P&T Dropdown field's options while creating this field type. Usually we have setting like:

option1 : value1 option2 : value2 ....

So if you are having all option : value pairs, all the options should be in same format i.e option&value be separated with colon.

Check if you are not having the default option in same format as other 2 options.

| improve this answer | |
  • " : Select One..." is of the same format and is what P&T recommends for how to handle an empty/null default value. Notice the space in front of the colon. – iDVB Mar 3 '13 at 22:16
  • Try by having some value before the : colon like "NO_VALUE : Select One...". – Bhashkar Yadav Mar 4 '13 at 2:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.