Hi there,
First of all this is a great module, it really comes in handy.
However, I like many people use a themed CCK form (see http://drupal.org/node/101092) and depending on the variables such as whether the user is authorized to access a field I like to hide certain fields on the page. I hide these fields using "unset($form['fieldname']);" the problem is that if I try to unset a field that uses Maxlength none of the javascript on the page will work which really is a pain because my form requires the use of fieldsets.
Cheers, Jake.

CommentFileSizeAuthor
#1 maxlength-error.patch1.07 KBdawehner

Comments

dawehner’s picture

Status: Active » Needs review
StatusFileSize
new1.07 KB

Does this patch fix your problem?

codenamerhubarb’s picture

Hey,
I just figured out that if I use: "$form['myfield']['#access'] = false;" instead of: "unset($form['myfield']);" it works perfectly but I will apply your patch and let you know if that works too. I have to go out right now so I'll do it tomorrow.
Thanks for your help.

*EDIT - I had a bit of time so I applied your patch and YES it fixed the problem. I can now use unset on fields using Maxlength. Thanks!

codenamerhubarb’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

johan2’s picture

Hi,
I have the same problem with 'unset' and 'false'. Both break the further functionality if I only want to hide some fields. My case is with an exposed form for 'gmap locpick' proximity/distance where the generated coordinates, longitude and latitude, should be hidden since they don't mean anything for the user. But the moment that these are unset in the template.php they are indeed hidden but the search result will return nothing. So the only thing that I can do is a css-trick ... hidden and height 0 ...
Has someone experienced the same problem with 'unset' ?
regards, Johan