SharePoint dropdown (None) default change . Jquery code
An开发者_运维问答y jquery code to change the default (None) in my SharePoint dropdown control.
It does not appear that (None) is actually my default as it does not really send (None).
I'd like to change it to (Please Select).
Thanks.
This works: http://jsfiddle.net/gilly3/F7PPK/
$("#mySelect option:eq(0)").text("Please Select").val("What you want sent here")
The following code will change the default text of all select controls to "Please Select" instead of "(None)":
$('select option[value="0"]').text("Please Select")
This code will do the same but only for select controls with a specific title:
$('select[title="your field title"] option[value="0"]').text("Please Select")
I used this when working with Sharepoint 2010, not sure if it works with all versions or not, but since it's generic jQuery code with nothing SP specific, I think it will.
精彩评论