jquery-selectutility
Retrieve machine-readable (database safe) value from Select node
-
Signatures
-
$(select element).mrValue();
-
$(select element).mrValue(domAttributeWhereMachineReadableValueIsSaved);
-
domAttributeWhereMachineReadableValueIsSaved defaults to 'data-value' if not specified as shown in the first signature
-
$('select#test').mrValue('data-somecustomname');
-
-
$(select element).mrValue(domAttributeWhereMachineReadableValueIsSaved, humanReadableOptionText);
- If not specified, humanReadableOptionText will take its value from the option element currently selected
$('select#test').mrValue('data-value', 'Something Below the Currently Selected Option');
-
-
Return Values
- Returns String when a match is found. If not,
-1
is returned
- Returns String when a match is found. If not,
Retrieve human-readable value from Select node based on machine-readable value
-
Signatures
-
$(select element).hrValue(domAttributeWhereMachineReadableValueIsSaved, machineReadableText);
$('select#test').hrValue('data-value', 'value_from_db');
-
-
Return Values
- Returns String when a match is found. If not,
-1
is returned
- Returns String when a match is found. If not,