Keyword

Turning fields from registration form required, how?

  • gerardo
  • gerardo's Avatar Topic Author
  • Visitor
13 years 2 months ago #98406 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!

Please Log in or Create an account to join the conversation.

  • gerardo
  • gerardo's Avatar Topic Author
  • Visitor
13 years 2 months ago #98407 by gerardo
Can any one help me with this PLEASE?!

 

I really need this!

Please Log in or Create an account to join the conversation.

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
  • gerardo's Avatar Topic Author
  • Visitor
13 years 2 months ago #98409 by gerardo
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)' ); ?>* </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)' ); ?>* </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.

More
13 years 4 weeks ago #98410 by johanna
Add to fields code that needs to be validated

Please Log in or Create an account to join the conversation.

More
13 years 1 day ago #98411 by johanna
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

Please Log in or Create an account to join the conversation.

More
13 years 22 hours ago #98412 by johanna
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.

Please Log in or Create an account to join the conversation.

  • gerardo
  • gerardo's Avatar Topic Author
  • Visitor
13 years 20 hours ago #98413 by gerardo
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.

Please Log in or Create an account to join the conversation.

More
13 years 16 hours ago #98414 by johanna
I did this with the extended fields plugin.

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum