Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Once i click on label select button should get open

Tags:

jquery

css

i want to open select button if i click on label ,

here is the code

<label>sachin</label>
<select>
    <option>1</option>
    <option>2</option>
    <option>3</option>
    <option>4</option>
</select>

is there any way in css or jquery ? i am not sure about this thing.

fiddle :http://jsfiddle.net/Yh3Jf/

like image 488
supersaiyan Avatar asked Mar 06 '13 14:03

supersaiyan


People also ask

How to display options of 3 labels on Confirmation Page?

I have a confirmation page that will display options of 3 labels depending on where you Navigate from It will be determined by button clicks on the page you come from. Button1 - Employee click submit - Navigate to Confirmation Screen and sees - EmployeeText Button 2 - Management clicks submit - Navigate to confirmation screen and sees - MgtText

How to make a button visible to the user?

To do that you'll need to set a variable using the onSelect property of the button and then set the visible property based on the value. Something like this. # In Button OnSelect Set (buttonPressed, "ButtonName") # In Label Visible If (buttonPressed = "ButtonName", true, false) If I have answered your question, please mark your post as Solved.

How to add twoclicked and oneclicked to a button control?

At first, Select the first Button control (Add to Cart) and apply this below formula on its OnSelect Property as: OneClicked, TwoClicked = These are the context variable name that I specified the boolean values true and false. You can enter any context variable names.

How to make a button show the value of a variable?

To do that you'll need to set a variable using the onSelect property of the button and then set the visible property based on the value. Something like this. If I have answered your question, please mark your post as Solved.


1 Answers

In case someone else is searching for this, I did this behavior by expanding the padding of the <select> tag, and making the label positioned absolute.

<div class="field-select">
  <label class="field-select__label" for="selector">Clickable Label</label>
  <select class="field-select__input" id="selector" name="selector">
    <option value="val1">value 1 </option>
    </option><option value="val2">Value 2</option>
  </select>
</div>

.field-select {
  position: relative;
}

.field-select__label {
  position: absolute;
  pointer-events: none;
  top: 5px;
  left: 0;
}

.field-select__input {
  padding: 50px 50px 20px 10px;
}

Check working example on codepen

like image 93
Nouran Mahmoud Avatar answered Nov 03 '22 00:11

Nouran Mahmoud