Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

CSS class not populating in textarea wrapper div


Go to End


4 Posts   1097 Views

Avatar
sam523

Community Member, 3 Posts

23 May 2013 at 9:35am

I've been on a new job so I'm not tremendously familiar with SilverStripe ... using it here is my first experience with it. That being said, I'm having a problem that I hope is super-simple that somebody can help me with, because I'm not having any luck solving it.

We have a form that has ~8-10 input fields and two of them aren't populating the CSS class in the div that wraps the div that contains the text area. For instance, we have this html rendering on our servers:

<div >
<div id="MemberBio" class="field textarea "><label class="left" for="Form_EditProfileForm_MemberBio">Talk about your previous work experience, your life, or both</label><div class="middleColumn"><textarea id="Form_EditProfileForm_MemberBio" name="MemberBio" rows="5" cols="20"></textarea></div></div>
</div>

but when we run the identical code base locally, we're getting

<div class="MemberBio">
<div id="MemberBio" class="field textarea "><label class="left" for="Form_EditProfileForm_MemberBio">Talk about your previous work experience, your life, or both</label><div class="middleColumn"><textarea id="Form_EditProfileForm_MemberBio" name="MemberBio" rows="5" cols="20"></textarea></div></div>
</div>

That MemberBio class in the div makes all the difference (without it the layout is pretty messed up) in this and I'm not having a ton of luck figuring out where this is generated. If anybody has any ideas, or can at least ask me questions that will steer me in the right direction, I would really appreciate it!

Thanks,
Sam

Avatar
Willr

Forum Moderator, 5523 Posts

23 May 2013 at 8:03pm

Not sure what the differences could be between your local and prod sites. I would investigate those differences (could be a different SS versions)

Avatar
sam523

Community Member, 3 Posts

24 May 2013 at 12:13am

That's the thing ... the code bases are identical, running 2.4.something. I guess what I'm wondering is where is the code that's the basis for the html that's rendered for the textarea and the wrapper div?

Avatar
Willr

Forum Moderator, 5523 Posts

24 May 2013 at 5:57pm

See http://doc.silverstripe.org/framework/en/topics/forms#custom-form-templates for information on custom form templates (if your form make use them). You can turn on template debugging to see where that div is coming from

// mysite/_config.php
SSViewer::set_source_file_comments(true);