Function to create slider with textfield