Showing posts with label select box. Show all posts
Showing posts with label select box. Show all posts

Saturday, September 25, 2010

jQuery value and text of selected option in selectbox

You often need the value and text of the selected option of a select box. $("#selectboxid").val() returns the value of the selected option and $("#selectboxid :selected").text() returns the text.

Solution found at:
http://marcgrabanski.com/articles/jquery-select-list-values

Friday, February 5, 2010

'not found in haystack' error in Zend

If you get a '%value%' was not found in the haystack' error when using select boxes in Zend, add the following to the form element:

$element->setRegisterInArrayValidator(false);

or directly when creating form:

$form->addElement('multiselect', 'elementname', array('RegisterInArrayValidator' => false));

Solution found at: http://stackoverflow.com/questions/991001/zendvalidatebetween-strange-error-message