This topic is locked

check a value of field script

9/26/2009 12:35:08 AM
PHPRunner General questions
M
meirco author

I only want to execute this if the value of description field is empty which is the case when adding new record.

this code is in visual editor html mode .

the code is always ignored.
<script>

if document.forms.editform.value_description.value == null

{
document.forms.editform.value_description.value = document.forms.editform.display_value_tcode.value;

document.forms.editform.value_tcode.onchange = function()

{

document.forms.editform.value_description.value = document.forms.editform.display_value_tcode.value;

}

}

</SCRIPT>

J
Jane 9/28/2009

Hi,
please see my changes below:

if (document.forms.editform.display_value_tcode.value!="")

document.forms.editform.value_description.value = document.forms.editform.display_value_tcode.value;

document.forms.editform.value_tcode.onchange = function()

{

document.forms.editform.value_description.value = document.forms.editform.display_value_tcode.value;

}