Adding a picker view on onclick of a text box
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.
精彩评论