This topic is locked

Conditional Display of Fields

2/25/2011 6:27:47 PM
PHPRunner General questions
R
rkiss author

Hi,
I know how to use Javascript Onload to hide fields, however, I still cannot figure out how to hide the whole row, including the field column name...
Any help is appreciated.
Thank you,
Regards,
Roman

P
procheck 2/25/2011

Just search this forum for "hide column" and "hide row" and you will find a lot of info.

R
rkiss author 2/25/2011

Solution:
document.getElementById("depositdiv1").style.display="table-row";

document.getElementById("depositdiv1").style.display="none";
Another question..
How would I implement if there are 2 conditions.....if value from one field and/or another value from another field....then hide the row.
Thank you,
Roman

P
procheck 2/25/2011

I've never hidden rows, only columns. Although for radio buttons here is something which might help you:
http://www.asprunner.com/forums/topic/14408-how-to-hide-or-display-a-cell-row-depending-on-radio-button/

R
rkiss author 2/26/2011

I am able to hide rows, just need some help how to hide rows if multiple conditions are true...
If value from one field and value from another field...then hide/show row.
Roman

P
procheck 2/26/2011

Can you give an example? I'm thinking that you're looking for more than a basic if statement.

R
rkiss author 3/7/2011



Can you give an example? I'm thinking that you're looking for more than a basic if statement.


Correct, this would be conditional statement if 2 conditions are TRUE using the Javascript ON LOAD events.

Sergey Kornilov admin 3/7/2011

Use the logical operator &&

if (condition1 && condition2) {action}
R
rkiss author 3/8/2011



Use the logical operator &&

if (condition1 && condition2) {action}



Hi Sergey,
How would this work with on load javascript?: I know the below code is incorrect
ctrlControl1.on('change', function(e)) && ctrlControl2.on('change', function(e))
if (this.getValue() == '1' && this2.getValue() == '1')

{

then action

}