PHP creating CSS hidden attribute changes table font

Issues related to forms.
Post Reply
bowlesj
 
 
Posts: 50
Joined: Tue Aug 12, 2014 6:59 pm

PHP creating CSS hidden attribute changes table font

Post by bowlesj » Mon Apr 09, 2018 1:05 pm

Hi,

my version of WYSIWYG Web Builder is not supported. However I thought you or someone might like to know about how I solved this problem.

I have a large form on a page that has two tables and a few input fields in the form of text box inputs and drop down selects. You can see it by going to this link http://www.yourcommonsongjams.com/frmJa ... _TS58.html
So in one situation I was using the PHP code below to hide the "desired days of week" text field and its label. If I put this PHP code before the tables right at the bottom of your "start of page" tab it hides the fields but messes up the font on the two tables causing them to go out of line. I discovered that if I move the exact same php code down to the "end of page" tab right before the php ob_end_flush(); command it fixes the problem and the table looks exactly like it should as showing in the link. So problem solved.

John

Code: Select all

//START: Code to hide select days of week
//I had to move the code down here because the hide statements were messing up the table font for some reason.
if ($DateLong != " Needs People") {
   echo "
   <style>
   #Editbox_DaysOfWeek {
      visibility: hidden;
   }
   #wb_Text_DaysOfWeek {
      visibility: hidden;
   }
   </style>
   ";
}
//END: Code to hide select days of week

User avatar
Pablo
 
Posts: 12219
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: PHP creating CSS hidden attribute changes table font

Post by Pablo » Mon Apr 09, 2018 1:16 pm

This code should not be added at the start of the page. It belongs between the head tags.

bowlesj
 
 
Posts: 50
Joined: Tue Aug 12, 2014 6:59 pm

Re: PHP creating CSS hidden attribute changes table font

Post by bowlesj » Mon Apr 09, 2018 1:31 pm

Thanks, I tried that and it worked. I figured it did not need to go at the very bottom but I am in a rush and didn't really have time to fiddle with perfection.

I figured it would work at the bottom because I have a situation where I have php code reading this html file and making visible the email button. Members of my group call the php code and outsiders call the html code only. The php code receives a security code which I can change but I suspect I never will have to change. Outsiders can't see it. I wanted to do this to avoid having the members of my group forced to remember a password. They are not very receptive to computers and I am trying to make things as easy for them as possible :-) This is how I got the idea to put the hidden statements it at the very end since the php code is completely outside the html code using the same css statements and it works.

Post Reply

Who is online

Users browsing this forum: nrgiser and 2 guests