J
|
Jane 4/30/2010 |
Hi, document.forms.editform1.value_FieldName_1.onchange=function()
{BEGIN FieldName1_fieldblock} <TR id=hidediv1 style="PADDING-RIGHT: 3px; PADDING-LEFT: 3px; PADDING-BOTTOM: 3px; PADDING-TOP: 3px"> <TD class=editshade_b style="PADDING-LEFT: 15px" width=150>{$label TableName FieldName1}</TD> <TD class=editshade_lb style="PADDING-LEFT: 10px" width=250>{$FieldName1_editcontrol} </TD></TR> {END FieldName1_fieldblock} {BEGIN FieldName2_fieldblock} <TR id=hidediv2 style="PADDING-RIGHT: 3px; PADDING-LEFT: 3px; PADDING-BOTTOM: 3px; PADDING-TOP: 3px"> <TD class=editshade_b style="PADDING-LEFT: 15px" width=150>{$label TableName FieldName2}</TD> <TD class=editshade_lb style="PADDING-LEFT: 10px" width=250>{$FieldName2_editcontrol} </TD></TR> {END FieldName2_fieldblock} |
![]() |
ffrinai author 5/4/2010 |
Hi, use custom JavaScript code (Add page: JavaScript Onload Event on the Events tab) to show/hide fields on the fly based on value selected in another field. Here is a sample: document.forms.editform1.value_FieldName_1.onchange=function()
|
J
|
Jane 5/4/2010 |
Hi, |
F
|
FunkDaddy 5/6/2010 |
I used this code and it does hide/show the row, except that when it shows the row (with the control & label I need) it displays it in very strangely... it squeezes both columns (label and edit control) into a single column under the label column of the control above it. Here is the screenshot I took (look at the "Attachment Type" field):
|
![]() |
Sergey Kornilov admin 5/6/2010 |
I would recommend to check if table structure is not broken. You can do this in Visual Editor in HTML mode. |
F
|
FunkDaddy 5/7/2010 |
I figured out the problem (sorry, but I already uploaded and opened a support ticket as instructed by Sergey)... After inspecting the <TR> element that I was hoping to show/hide on demand (based on a value selected in a dropdown control above it)I simply changed the javascript code where it read: |
A
|
ann 5/12/2010 |
Hi, document.getElementById("hidediv1").style.display="table-row";
document.getElementById("hidediv1").style.display=""; |
F
|
FunkDaddy 5/12/2010 |
Thanks Ann... I'll give your solution a try. Mine worked as well, but your code looks cleaner to me. |