0

How can I add a picker view on onclick of a text box.

Here's the code I am using for the text box:

<td>
<input value="0" id="LVAD1" name="h9" style="height: 22px;width:48px;
                        margin-left:2px;"readonly="readonly"; type="text">
</td>

I created separate PickerView.h and pickerView.m files and have created the delegates.

I just need the know how to provide connection between the pickerview and textbox.

Jeff Mercado
  • 129,526
  • 32
  • 251
  • 272
shasha
  • 615
  • 2
  • 14
  • 26
  • Could you tell what do you mean by picker view ? is it a date picker ? or else ? I think you must use onclick event for textbox and display:none property for picker view! – niko Oct 17 '11 at 08:28
  • Hi niko, i am not looking for a date picker.i am looking for a Picker view - Displays a spinning wheel or slot-machine motif of values. – shasha Oct 17 '11 at 08:43

1 Answers1

0

I expect this is what you are looking for: at the start, set style="display:none" for the picker and use onclick event for textbox.

<head>
<script type="text/javascript">
   function enable_picker()
   {
   var picker = document.getElementById('picker');
   picker.style.display="block";
   }
</script>
</head>
   <h1 id="picker" style="display:none">hello</h1>
   <input type="text" onclick="enable_picker()"/>

Don't forget to set id="picker" for picker view or, to be simple, just go for jQuery plugins hide, show properties and animation effects!

I don't really know what a picker is but the above code pops out hello when you click the textbox.

fragilewindows
  • 1,394
  • 1
  • 15
  • 26
niko
  • 9,285
  • 27
  • 84
  • 131