PHP hide form element?

genyded

Active Member
Hi,

Is there a PHP based way to hide a form element... I dug around a bit and could not find anything (I know it can be done in JS or CSS - but I am already doing some PHP stuff onLoad so would prefer it there)

TIA,
Dale
 
Define "hide". Do you just want it "hidden" in the CSS sense of the word (so a display=none attribute), or removed entirely from the visible form inputs, and added as part of the truly hidden elements on the form, whereby they get added to our array of truly hidden, encrypted form elements (as if the user did not have ACL's for read access).

-- hugh
 
Either could work... but the 2nd is probably optimal. The scenario is that an application "admin" (not a Joomla or site admin) sets some options is one form that control whether other user in another form can see or access some elements of the 2nd form. I was hoping not to have to manage a bunch of ACL's for that.

The thought was if element A = no access for users, then hide it on the 2nd form load. So I'd need to look up the option for that element in the 1st forms table and if set to no access, then hide it. I can use JS/CSS to hide, but am already doing some things on the 2nd form load in a PHP form plugin, so if anyone could think of or knows a way to hide it there... that would save me a trip to the server during the load.

Otherwise, I have to do the php load stuff then make an Ajax call to the server to hide stuff (or move all the existing php to JS or wherever I end up putting the hide stuff) to optimize the load speed. I can make it all work in one call one way or another... just thought if anyone knew a quick easy way to hide or even remove from php, I'd do it there since already have a check of code doing some other stuff there.

Thanks,
Dale
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top