- Posts: 14
COMMUNITY FORUM
Make EXTRA fields REQUIRED
- Serr.biz LLC
-
Topic Author
- Offline
- New Member
Less
More
15 years 4 months ago #76618
by Serr.biz LLC
Make EXTRA fields REQUIRED was created by Serr.biz LLC
I would like to make some EXTRA fields REQUIRED. Any ideas?
Please Log in or Create an account to join the conversation.
- Long Winter
-
- Offline
- New Member
Less
More
- Posts: 5
15 years 3 months ago #76619
by Long Winter
Replied by Long Winter on topic Make EXTRA fields REQUIRED
Me too.. and the basic content area also...??
:)
:)
Please Log in or Create an account to join the conversation.
- Omar Al-Ansari
-
- Offline
- New Member
Less
More
- Posts: 14
15 years 2 months ago #76620
by Omar Al-Ansari
Replied by Omar Al-Ansari on topic Make EXTRA fields REQUIRED
Any luck on the this?
Please Log in or Create an account to join the conversation.
- Serr.biz LLC
-
Topic Author
- Offline
- New Member
Less
More
- Posts: 14
15 years 1 month ago #76621
by Serr.biz LLC
Replied by Serr.biz LLC on topic Make EXTRA fields REQUIRED
Nope.
Please Log in or Create an account to join the conversation.
- carmiaca
-
- Offline
- New Member
Less
More
- Posts: 4
14 years 3 months ago #76622
by carmiaca
Replied by carmiaca on topic Make EXTRA fields REQUIRED
Open in Dreamweaver or Notepad the components>com_k2>views>item>tmpl>form.php page. Edit the submitbutton(pressbutton) function by adding an "else if" line for each field you want to be required and the appropriate alert text. For example:
} else if (trim( document.adminForm.K2ExtraField_1.value ) == "") { alert( '<?php echo JText::_('You must enter the name of your project', true); ?>' );
Make sure you add it before the final " } else { " statement. You can find out the id of the field (in this case K2ExtraField_1) by using a tool like Firebug in a Firefox browser. The fields may not have the id number you expect, so you need to check it with a tool like Firebug.
} else if (trim( document.adminForm.K2ExtraField_1.value ) == "") { alert( '<?php echo JText::_('You must enter the name of your project', true); ?>' );
Make sure you add it before the final " } else { " statement. You can find out the id of the field (in this case K2ExtraField_1) by using a tool like Firebug in a Firefox browser. The fields may not have the id number you expect, so you need to check it with a tool like Firebug.
Please Log in or Create an account to join the conversation.
- carmiaca
-
- Offline
- New Member
Less
More
- Posts: 4
14 years 3 months ago #76623
by carmiaca
Replied by carmiaca on topic Make EXTRA fields REQUIRED
You can also find the ID number for the field from the K2 Extra Fields administrator view
Please Log in or Create an account to join the conversation.
- BBC
-
- Offline
- Platinum Member
Less
More
- Posts: 663
14 years 3 months ago #76624
by BBC
Replied by BBC on topic Make EXTRA fields REQUIRED
I would like to see a little bit of documentation for extra fields coding.
As it is now, even Sobi2 has better manuals. And they are not so known for huge manuals.
As it is now, even Sobi2 has better manuals. And they are not so known for huge manuals.
Please Log in or Create an account to join the conversation.
- carmiaca
-
- Offline
- New Member
Less
More
- Posts: 4
14 years 3 months ago #76625
by carmiaca
Replied by carmiaca on topic Make EXTRA fields REQUIRED
I agree. I had to figure this out myself.
Please Log in or Create an account to join the conversation.
- shemul
-
- Offline
- New Member
Less
More
- Posts: 12
13 years 10 months ago #76626
by shemul
Replied by shemul on topic Make EXTRA fields REQUIRED
thank you so much......
Please Log in or Create an account to join the conversation.