开发者

Adding a picker view on onclick of a text box

开发者 https://www.devze.com 2023-04-13 06:21 出处:网络
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>

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.开发者_StackOverflow中文版h and pickerView.m files and have created the delegates.

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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号