1

I have a piece of code which is written at client side like this:

JS code:

jQuery(document).ready(function () {
    alert("hello");
    /*jQuery("#cca").on('change', 'label.control input', function (event) {*/
    jQuery("#cca").change(function () {
        var txtcca = document.querySelector('#cca label.control input ').value;
        alert('I am pretty sure the text box changed');
        if (txtcca != "") {
            alert("1");
            jQuery("#tan").find('label.control input').prop('disabled', true).css('background-    color', '#FF0033');
        }
        if (txtcca == "") {
            alert("2");
            jQuery("#tan").find('label.control input').prop('disabled', false);
        }
    });
});

Same code when i implement in server side and executed it is showing only first alert=>hello and nothing is displayed. Require solution.

HTML markup:

<div id="cca" class="leaf">
    <label class="control input text" title=""> <span class="wrap">cca</span>
        <input class="" type="text" value="[Null]" /> <span class="warning"></span>
    </label>
</div>
<div id="ccit" class="leaf">
    <label class="control input text" title=""> <span class="wrap">ccit</span>
        <input class="" type="text" value="[Null]" /> <span class="warning"></span>
    </label>
</div>
<div id="cit" class="leaf">
    <label class="control input text" title=""> <span class="wrap">cit</span>
        <input class="" type="text" value="[Null]" /> <span class="warning"></span>
    </label>
</div>
<div id="tan" class="leaf">
    <label class="control input text" title=""> <span class="wrap">tan</span>
        <input class="" type="text" value="[Null]" /> <span class="warning"></span>
    </label>
</div> 

LIVE DEMO

Satinder singh
  • 10,100
  • 16
  • 60
  • 102
Pallavi
  • 313
  • 1
  • 4
  • 17
  • 1
    possible duplicate of [event.returnValue is deprecated. Please use the standard event.preventDefault() instead](http://stackoverflow.com/questions/20045162/event-returnvalue-is-deprecated-please-use-the-standard-event-preventdefault) – jfriend00 Dec 19 '13 at 06:12
  • How is it implemented server side? – Magnus Engdal Dec 19 '13 at 06:13
  • 1
    @Thota pallavi: Pls check the demo have edited ur question, n let me know what exactly the problem u facing – Satinder singh Dec 19 '13 at 06:19
  • Satinder, Require better solution that it works with jquery-1.7.1.min.js with change event – Pallavi Dec 19 '13 at 07:38

1 Answers1

0

ur demo is working fine but when am executing in server side then it is not working and am using jquery-1.7.1.min.js version in jasper server location now i have to upgrade it to never version. In demo if you change it to the version which i have specified then it will not work.

jasim
  • 268
  • 1
  • 5
  • 16