Jump to content

How to fire a script with input controls of jasper server


pallavi.thota

Recommended Posts

I have four input controls in jasper server like CCA, CCIT, CIT and TAN.

 

Now those four fields has to get validated and proper alert message has to be displayed

when

TAN input control is entered other CCA, CCIT and CIT has to get disabled

and when

you enter anything in CCA, CCIT and CIT then TAN input has to get disabled.

 

this validations i has generated in JSP code and trying to publish a report in jasperserver by script is as follows:

 

 

 

function disableElements(){

 

var cca1=document.getElementById("cca").value;

var ccit1=document.getElementById("ccit").value;

var cit1=document.getElementById("cit").value;

var tan1=document.getElementById("tan").value;

 

 

if((cca1!="")||(ccit1!="")||(cit1!=""))

{

alert("1");

document.getElementById("tan").disabled=true;

 

}

 

if((cca1=="")&&(ccit1=="")&&(cit1==""))

{

alert("2");

document.getElementById("tan").disabled=false;

 

}

 

 

}

 

 

function disableElements1(){

var tan1=document.getElementById("tan").value;

alert(tan1);

if(tan1=="")

{

document.getElementById("cca").disabled=false;

document.getElementById("ccit").disabled=false;

document.getElementById("cit").disabled=false;

}else

{

document.getElementById("cca").disabled=true;

document.getElementById("ccit").disabled=true;

document.getElementById("cit").disabled=true;

}

}

 

function checkValue(){

var checkStr=documentforms[0].elements[4].value;

alert(checkStr);

//Regex obj = new Regex("[A-z]{5}[0-9]{4}[A-z]{1}");

if(checkStr.match(/b[A-z]{5}[0-9]{4}[A-z]{1}b/)==null){

alert("Please enter 5 alphabetic 4 numeric and 1 alphabet only in the field");

return false;

}

}

 

This script is working fine when i use input fields in jsp and execute.

 

But, when i use same script with same input control names and all no alert window nor any kind of messages are displayed nor report values get changed..

 

 

I need solution how to make input controls can speak with script and fire proper alert messages.

 

 

Thank you in advance.

Pallavi Thota.

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...