Problem with adjacent function in prototype
- by xain
Hi, I have this code:
<input name="rz" class="required validate-string" style="margin-left:17px" id="rz" title="Input rz value" size="23" />
<p class="msg" style="display:none;">Input rz value</p>
In the head I have:
Event.observe(window, 'load', function() {
$$("input").each(function(field){
Event.observe(field, "focus", function(input) {
input.adjacent('p.msg').show();
});
Event.observe(field, "blur", function(input) {
input.adjacent('p.msg').hide();
});
});
});
The idea is that when the input get the focus, the p element appears and on blur it goes away. The problem is that neither is working, and the error console shows "input.adjacent is not a function"
I'm using prototype 1.6.1 and scriptaculous 1.8.3