optimize code and add a action to handle form's select operation
add select