This topic is locked
[SOLVED]

 hide a row in JavaScript

1/19/2012 5:55:29 AM
PHPRunner General questions
author

Hi
I would like to hide a whole row on the add page. I have used JavaScript hide fields with the below code. How can I modify this to hide the whole row in PHPrunner 6.0
var ctrl_type = Runner.getControl(pageid, 'type');

ctrl_type.hide();
This post [http://www.asprunner.com/forums/topic/18158-nesting-ifs-in-javascript/page'>http://www.asprunner.com/forums/topic/18158-nesting-ifs-in-javascript/pagehldocumentgetElementById(fromsearch1]("http://www.asprunner.com/forums/topic/18158-nesting-ifs-in-javascript/page'>http://www.asprunner.com/forums/topic/18158-nesting-ifs-in-javascript/pagehldocumentgetElementById(fromsearch1") explains it but from my understanding this will not work in 6 and as the visual editor is coded differently now
Thanks in anticipation

C
cgphp 1/19/2012
$("input[id^='value_fieldname']").parents('tr:eq(0)').hide();


where fieldname is the name of the field. If the field is a dropdown replace input with select.

Sergey Kornilov admin 1/19/2012

I use a slightly different syntax which does the job as well:

// hide

$("input[id^='value_fieldname']").parentsUntil('tbody').hide();

// show

$("input[id^='value_fieldname']").parentsUntil('tbody').show();