Skip to main content
Commonmark migration
Source Link

So, after some more digging this morning and banging my head I found a solution using SPServices. First, convert the field from a complex to a simple drop down:

$().SPServices.SPComplexToSimpleDropdown({  
    columnName: "myColumn"
});

Then, you can get the ID (and then the value) by using what SPServices has cleverly injected:

$('#SPComplexToSimpleDropdown_myColumn').val();

I'm still not sure of a way to do this without SPServices but I think it has to do with how SharePoint is doing funny business with the input field.

#PS: set the value

PS: set the value

If you want to set the value of the dropdown you need to fire the change() event after setting it so the internal code gets tapped.

$('#SPComplexToSimpleDropdown_myColumn').val(15).change();

So, after some more digging this morning and banging my head I found a solution using SPServices. First, convert the field from a complex to a simple drop down:

$().SPServices.SPComplexToSimpleDropdown({  
    columnName: "myColumn"
});

Then, you can get the ID (and then the value) by using what SPServices has cleverly injected:

$('#SPComplexToSimpleDropdown_myColumn').val();

I'm still not sure of a way to do this without SPServices but I think it has to do with how SharePoint is doing funny business with the input field.

#PS: set the value

If you want to set the value of the dropdown you need to fire the change() event after setting it so the internal code gets tapped.

$('#SPComplexToSimpleDropdown_myColumn').val(15).change();

So, after some more digging this morning and banging my head I found a solution using SPServices. First, convert the field from a complex to a simple drop down:

$().SPServices.SPComplexToSimpleDropdown({  
    columnName: "myColumn"
});

Then, you can get the ID (and then the value) by using what SPServices has cleverly injected:

$('#SPComplexToSimpleDropdown_myColumn').val();

I'm still not sure of a way to do this without SPServices but I think it has to do with how SharePoint is doing funny business with the input field.

PS: set the value

If you want to set the value of the dropdown you need to fire the change() event after setting it so the internal code gets tapped.

$('#SPComplexToSimpleDropdown_myColumn').val(15).change();
added 227 characters in body
Source Link
thornomad
  • 429
  • 4
  • 9
  • 20

So, after some more digging this morning and banging my head I found a solution using SPServices. First, convert the field from a complex to a simple drop down:

$().SPServices.SPComplexToSimpleDropdown({  
    columnName: "myColumn"
});

Then, you can get the ID (and then the value) by using what SPServices has cleverly injected:

$('#SPComplexToSimpleDropdown_myColumn').val();

I'm still not sure of a way to do this without SPServices but I think it has to do with how SharePoint is doing funny business with the input field.

#PS: set the value

If you want to set the value of the dropdown you need to fire the change() event after setting it so the internal code gets tapped.

$('#SPComplexToSimpleDropdown_myColumn').val(15).change();

So, after some more digging this morning and banging my head I found a solution using SPServices. First, convert the field from a complex to a simple drop down:

$().SPServices.SPComplexToSimpleDropdown({  
    columnName: "myColumn"
});

Then, you can get the ID (and then the value) by using what SPServices has cleverly injected:

$('#SPComplexToSimpleDropdown_myColumn').val();

I'm still not sure of a way to do this without SPServices but I think it has to do with how SharePoint is doing funny business with the input field.

So, after some more digging this morning and banging my head I found a solution using SPServices. First, convert the field from a complex to a simple drop down:

$().SPServices.SPComplexToSimpleDropdown({  
    columnName: "myColumn"
});

Then, you can get the ID (and then the value) by using what SPServices has cleverly injected:

$('#SPComplexToSimpleDropdown_myColumn').val();

I'm still not sure of a way to do this without SPServices but I think it has to do with how SharePoint is doing funny business with the input field.

#PS: set the value

If you want to set the value of the dropdown you need to fire the change() event after setting it so the internal code gets tapped.

$('#SPComplexToSimpleDropdown_myColumn').val(15).change();
Source Link
thornomad
  • 429
  • 4
  • 9
  • 20

So, after some more digging this morning and banging my head I found a solution using SPServices. First, convert the field from a complex to a simple drop down:

$().SPServices.SPComplexToSimpleDropdown({  
    columnName: "myColumn"
});

Then, you can get the ID (and then the value) by using what SPServices has cleverly injected:

$('#SPComplexToSimpleDropdown_myColumn').val();

I'm still not sure of a way to do this without SPServices but I think it has to do with how SharePoint is doing funny business with the input field.