back to phpList.org

Add a text label to the subscriber form?


#1

Is there a way to add a simple text label to the form without having a field associated? I would like to include an explanation for a group of attributes so subs know why we are requesting the info.

The only thing that I can do is create an attribute with a radio button (checkbox, selection, etc.) element and not include any values. Unfortunately, this causes the label text to display in red along with an asterisk even though I did not check the “required” box. The information it refers to is not necessarily required.

I tried selecting the “hidden” field type, but that hides the field label along with the field. Any help is appreciated!


#2

@veramilo I don’t know of a way to do that, though you could add the explanation to the subscribe page text, above the form.

It sounds like you are also reporting a bug where attributes which should not be required, in fact are?


#3

Yes, it does seem to be a bug, but perhaps it displays in red because I did not include a value list. It may not be the worst thing for it to be red. It does make it stand out.

I don’t think adding the explanation at the top will work very well since it’s too far from the requested info.

Thank your reply.


#4

You may be able to add your text label in the subscribe form if you edit the ListAttributes function in subscribe2lib.php. You would add a conditional statement before the code for the attributes. For example, if you wanted to add the text label immediately before an attribute labeled Name, then you might use if ($attr[‘name’] != ‘Name’) { … } and insert a line $html .= ‘text for explanation for attributes’;
I actually edited the ListAttributes function so that Name attribute came before the email and password inputs and the remaining attributes came after the email and password inputs.
You can check out my subscribe form at http://www.sudburyminutemen.org/lists/?p=subscribe&id=1
If you need help, I may be able to work with you.