So I worked around this by creating my own custom fieldType, just using the Contour.SharedSource.Providers.FieldTypes dropDownlist source as a starting point and removing the blank options.
However, I notice that using this as a starting point I don't get the default value setting that is available on the dropdownlist field type... how can I get that back?
Also, is there any mechanism for setting an "initial value" for the mandatory validator (like we have on a standard .net required validation control)
I want to have a "please select one of the following" as the first item of the drop down, but don't want that to be seen as a valid choice by the validator, so like I say the equivalent of the initial value setting on the .net validator
(we want this as just having the values in there with no select ends up with the form just being submitted with the first option left as selected all the time, end users heh!)
I think the shared source code is a bit out of date, the default values were added to contour fairly recently, and I'm not sure if the shared source has been updated to include those in (although I could be wrong). It might be worth checking with either Tim G, or Per to see if they plan to update the shared source with that extra functionality.
Has anyone had any luck with this? I am trying to be able to have 'Please select' instead of just blank for the first dropdown but still be able to use the default value.
Probably the simplest way to do this would be to use jQuery to hange the text on the first item in the list from blank to whatever you wanted using the onload event.
empty option in the dropdownlisttype
how can I remove the empty option that exists as the first item of the dropdownlisttype?
So I worked around this by creating my own custom fieldType, just using the Contour.SharedSource.Providers.FieldTypes dropDownlist source as a starting point and removing the blank options.
However, I notice that using this as a starting point I don't get the default value setting that is available on the dropdownlist field type... how can I get that back?
Also, is there any mechanism for setting an "initial value" for the mandatory validator (like we have on a standard .net required validation control)
I want to have a "please select one of the following" as the first item of the drop down, but don't want that to be seen as a valid choice by the validator, so like I say the equivalent of the initial value setting on the .net validator
(we want this as just having the values in there with no select ends up with the form just being submitted with the first option left as selected all the time, end users heh!)
not sure if this is correct... but couldn't find a way to hook into the defaultValue like with the deafult dropdownlist.
any one care to comment?
Hiya,
I think the shared source code is a bit out of date, the default values were added to contour fairly recently, and I'm not sure if the shared source has been updated to include those in (although I could be wrong). It might be worth checking with either Tim G, or Per to see if they plan to update the shared source with that extra functionality.
Cheers,
Tim.
Have you had any luck with this Mike?
Regards
TT
I've implemented a custom fieldtype along the lines above... I didn't actually need the deafultValue to function for my particular needs.
Many thanks Mike.
Has anyone had any luck with this? I am trying to be able to have 'Please select' instead of just blank for the first dropdown but still be able to use the default value.
@Seth,
Probably the simplest way to do this would be to use jQuery to hange the text on the first item in the list from blank to whatever you wanted using the onload event.
:)
is working on a reply...