on 03-27-2006 1:11 PM
Hello I have problem with refresh of data afeer implementing a javascript function in the template SAPLBBP_PDH_CUF_100.
Here the source code :
function activer(i)
{
var j = i + 1;
var coche = 'GT_DISPLAY_100-VALUE['i']';
var montant = 'GT_DISPLAY_100-VALUE['j']';
if(document.BBPForm.elements[coche].checked == true)
{
document.BBPForm.elements[montant].disabled = false;
document.BBPForm.elements[coche].value = "X";
}
if(document.BBPForm.elements[coche].checked == false)
{
document.BBPForm.elements[montant].disabled = true;
document.BBPForm.elements[montant].value = '0,00';
}
}
<input type="checkbox" name="GT_DISPLAY_100-VALUE[`j`]" onClick="activer(`j`)" value="X" checked>
<input type="text" id="GT_DISPLAY_100-TEXT[`j1`]" name="GT_DISPLAY_100-VALUE[`j1`]" value="`GT_DISPLAY_100-VALUE[j+1]`" maxlength="013" size="013">
I would like to active or desactivate an input text field when click or unclick a checkbox.
The problem is that when i click the checkbox and fill the input text, the data is correcly updated, but when i want to unclick the checkbox, the data is not updated, end always show the last value and the checkbox is always checked.
It works in the SAPGUI but it doesn't work in the template..
thank for your help.
It is ok now.
I replaced the disbled fonction to readOnly javascript fonction. Don't know the reason but it works now.
Like that:
function activer(i)
{
var j = i + 1;
var coche = 'GT_DISPLAY_100-VALUE['i']';
var montant = 'GT_DISPLAY_100-VALUE['j']';
if(document.BBPForm.elements[coche].checked)
{
document.BBPForm.elements[montant].readOnly = false;
document.BBPForm.elements[coche].value = 'X';
}
if(document.BBPForm.elements[coche].checked == false)
{
document.BBPForm.elements[montant].readOnly= true;
document.BBPForm.elements[montant].value = '0,00';
document.BBPForm.elements[coche].value = ' ';
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.