Parent and Child Default Selection

Nov 22, 2010 at 5:24 PM
Edited Nov 22, 2010 at 5:49 PM

1. Want to show default value for the parent drop down blank instead of "(None)" or the first available value. ? (I want use to pick a value and by default it should be showing blank). (in my dev environment default value for parent is showing none but in test environment the first item is selected).

Can it be done easily??

 

The following seems to be working...

2. Default value for Child drop down to blank instead of "(None)" or first available value.

I modified the jquery.spservices-0.5.6.min.js to this line case"C":ae=ac?"":"|0" and now blank is showing for child category

Coordinator
Nov 22, 2010 at 6:34 PM

Moe:

1) Sounds like you have the column required in dev, but not in test.
2) So you're all set on this? It may also be the same issue. Make sure that the required setting is the same in both environments.

M.

Nov 22, 2010 at 7:29 PM

Yes, you are correct. I changed my dev box and made column to be required. But parent drop down list automatically selecting the first value from the look up list. hmm. i like this to be blanked.

Coordinator
Nov 22, 2010 at 7:33 PM

If it's a required column, then there is no blank option as SharePoint creates the dropdown. If you added a blank option and the user selected it, then you'd get a nasty error on submit. That said, you can certainly use script to add one. I'd suggest using the PreSaveAction to ensure that the option isn't blank on submit.

M.

Nov 22, 2010 at 7:55 PM

Marc,

You are right. Sharepoint default behavior is to put (None) for the column (drop-down column) if not required. SharePoint also picks the first available value from the lookup list if the dropdown column is set to required.

Is there a way to over-write this behavior so that the all the field looks consistent? I just this to be blanked.

Coordinator
Nov 22, 2010 at 7:57 PM

As I said above, you can write script to do anything you want.  Just be careful about how you set it up from a user perspective.

M.

Nov 22, 2010 at 8:00 PM

Do you have any sample script as I am new to jquery?

 

Coordinator
Nov 22, 2010 at 8:12 PM

SPServices is about as full a set of samples as you'll ever need!

If you're going to do this, you'll need to do the PreSaveAction thing as well, so you'll have some coding to do.

M.

Nov 22, 2010 at 8:24 PM

Great. Thanks for the help and being so prompt.

Thanks again.....