- Posts: 3722
COMMUNITY FORUM
Turning fields from registration form required, how?
- gerardo
- Topic Author
- Visitor
13 years 2 months ago #98406
by gerardo
Turning fields from registration form required, how? was created by gerardo
I want to make two fields from the registration form required. The first one is the description and the second one is the avatar image. The file is in components -> com_k2 -> templates -> registration.php
So how can I turn both, description and the avatar image, from the registration form required?
Thank you for any feedback!
So how can I turn both, description and the avatar image, from the registration form required?
Thank you for any feedback!
Please Log in or Create an account to join the conversation.
- gerardo
- Topic Author
- Visitor
13 years 2 months ago #98407
by gerardo
Replied by gerardo on topic Turning fields from registration form required, how?
Can any one help me with this PLEASE?!
I really need this!
I really need this!
Please Log in or Create an account to join the conversation.
- william white
- Offline
- Platinum Member
Less
More
13 years 2 months ago #98408
by william white
Replied by william white on topic Turning fields from registration form required, how?
Have you tried adding " class="inputbox required" to the image and description input code in registration.php?
Please Log in or Create an account to join the conversation.
- gerardo
- Topic Author
- Visitor
13 years 2 months ago #98409
by gerardo
Replied by gerardo on topic Turning fields from registration form required, how?
Thanks for your help William. I checked out both strings:
DESCRIPTION:
<td><label id="descriptionmsg" for="description"><?php echo JText::_( 'Description' ); ?>*</label></td> <td><?php echo $this->editor; ?></td>
AVATAR:
<td><label id="imagemsg" for="image"><?php echo JText::_( 'User image (avatar)' ); ?>*&nbsp;</label></td> <td><input type="file" id="image" name="image"/> <?php if ($this->K2User->image): ?>" <img class="k2AdminImage" src="<?php echo JURI::root().'media/k2/users/'.$this->K2User->image; ?>" alt="<?php echo $this->user->name; ?>" />" <?php endif; ?></td>
But I'm totally lost as to how exactly to add class="inputbox required" to either string. Do you (or anyone else) have an idea?
Thanks again for all the help!
<td><label id="imagemsg" for="image"><?php echo JText::_( 'User image (avatar)' ); ?>*&nbsp;</label></td> <td><input type="file" id="image" name="image"/> <?php if ($this->K2User->image): ?>" <img class="k2AdminImage" src="<?php echo JURI::root().'media/k2/users/'.$this->K2User->image; ?>" alt="<?php echo $this->user->name; ?>" />" <?php endif; ?></td>
DESCRIPTION:
<td><label id="descriptionmsg" for="description"><?php echo JText::_( 'Description' ); ?>*</label></td> <td><?php echo $this->editor; ?></td>
AVATAR:
<td><label id="imagemsg" for="image"><?php echo JText::_( 'User image (avatar)' ); ?>*&nbsp;</label></td> <td><input type="file" id="image" name="image"/> <?php if ($this->K2User->image): ?>" <img class="k2AdminImage" src="<?php echo JURI::root().'media/k2/users/'.$this->K2User->image; ?>" alt="<?php echo $this->user->name; ?>" />" <?php endif; ?></td>
But I'm totally lost as to how exactly to add class="inputbox required" to either string. Do you (or anyone else) have an idea?
Thanks again for all the help!
<td><label id="imagemsg" for="image"><?php echo JText::_( 'User image (avatar)' ); ?>*&nbsp;</label></td> <td><input type="file" id="image" name="image"/> <?php if ($this->K2User->image): ?>" <img class="k2AdminImage" src="<?php echo JURI::root().'media/k2/users/'.$this->K2User->image; ?>" alt="<?php echo $this->user->name; ?>" />" <?php endif; ?></td>
Please Log in or Create an account to join the conversation.
- johanna
- Offline
- New Member
Less
More
- Posts: 15
13 years 4 weeks ago #98410
by johanna
Replied by johanna on topic Turning fields from registration form required, how?
Add to fields code that needs to be validated
Please Log in or Create an account to join the conversation.
- johanna
- Offline
- New Member
Less
More
- Posts: 15
13 years 1 day ago #98411
by johanna
Replied by johanna on topic Turning fields from registration form required, how?
Sorry that makes no sense at all. ;)
I also need to have the Extended fields plugin to make the additional fields required so I am looking at this:
docs.joomla.org/Client-side_form_validation#Enable_the_Valid...
johanna said:
Add to fields code that needs to be validated
I also need to have the Extended fields plugin to make the additional fields required so I am looking at this:
docs.joomla.org/Client-side_form_validation#Enable_the_Valid...
johanna said:
Add to fields code that needs to be validated
Please Log in or Create an account to join the conversation.
- johanna
- Offline
- New Member
Less
More
- Posts: 15
13 years 22 hours ago #98412
by johanna
Replied by johanna on topic Turning fields from registration form required, how?
Open the \plugins\k2\userExtendedFields.xml file and add class="inputbox required" to those registration form fields that you want to have "required".
Refer to Client side form validation in the Joomla documentation.
Refer to Client side form validation in the Joomla documentation.
Please Log in or Create an account to join the conversation.
- gerardo
- Topic Author
- Visitor
13 years 20 hours ago #98413
by gerardo
Replied by gerardo on topic Turning fields from registration form required, how?
THANKS JOHANNA!
That might be the answer! Have you tried in K2 forms? I don't know when I'll have the time to try it out.
That might be the answer! Have you tried in K2 forms? I don't know when I'll have the time to try it out.
Please Log in or Create an account to join the conversation.
- johanna
- Offline
- New Member
Less
More
- Posts: 15
13 years 16 hours ago #98414
by johanna
Replied by johanna on topic Turning fields from registration form required, how?
I did this with the extended fields plugin.
Please Log in or Create an account to join the conversation.