This topic is locked

hiding HTML tables

3/31/2018 7:41:13 AM
PHPRunner General questions
mtpocket author

Greetings everyone,
I'm using PHPRunner 9.8 with bootstrap.
On my view page I've created 5 html tables placed neatly above one another, 4 col x 4 rows.

<TABLE width="90%" align="center" id="Brand_1" border="1" cellspacing="0" cellpadding="0">

<TR>

etc....

</TR>

</TABLE>

<TABLE width="90%" align="center" id="Brand_2" border="1" cellspacing="0" cellpadding="0">

<TR>

etc....

</TR>

</TABLE>

<TABLE width="90%" align="center" id="Brand_3" border="1" cellspacing="0" cellpadding="0">

<TR>

etc....

</TR>

</TABLE>

<TABLE width="90%" align="center" id="Brand_4" border="1" cellspacing="0" cellpadding="0">

<TR>

etc....

</TR>

</TABLE>

etc..
My objective is to hide the table / tables if "Brand_No." = '0' & I've even created an id for the table.

I've searched your archive & cannot seem to get an answer.

I do not want to hide the row or cell as it takes up space on the view page.
Any assistance will be appreciated.
Thanks

<img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=25456&image=1&table=forumtopics' class='bbc_emoticon' alt=':blink:' />

admin 3/31/2018

The following is the code that will hide the first table using jQuery:

$("#Brand_1").hide();


To execute this code dynamically when, for instance, the value of Brand_0 field changes, check this article:

https://xlinesoft.com/phprunner/docs/show_dropdown_list_of_us_states.htm

mtpocket author 4/3/2018



The following is the code that will hide the first table using jQuery:

$("#Brand_1").hide();


To execute this code dynamically when, for instance, the value of Brand_0 field changes, check this article:

https://xlinesoft.com/phprunner/docs/show_dropdown_list_of_us_states.htm


Thanks for quick response Admin.
I've tried the above with no success.

On the "View page, JavaScript OnLoad event" I did the following: -
var ctrlQ2 = Runner.getControl(pageid, 'Quantity_2');

ctrlQ2.on('change', function(e) {

if (this.getValue() == '0')

$('#Brand_2').hide(); //This is a table

});


Thanks
<img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=84717&image=1&table=forumreplies' class='bbc_emoticon' alt=';)' />

admin 4/4/2018

I see, there is no 'change' event on the View page. Here is what you need to do.

  1. Use BeforeDisplay event to pass the value of Brand_0 field to Javascript:

    https://xlinesoft.com/phprunner/docs/setproxyvalue.htm
  2. In Javascript OnLoad event analyze the value of Brand_0 field and hide those tables if required.