- Posts: 20
- Thank you received: 1
How to hard code a value in a new event form
- bneilson
- Topic Author
- Offline
- Junior Member
-
Less
More
13 years 1 week ago #15386
by bneilson
How to hard code a value in a new event form was created by bneilson
Hello,
I am trying to hard coded a few values in my new event form and was hopeful that somebody might be able to assist.
In this case I want to hard code (or at least default) a value in the Cancel By Date for event registrations.
I have found the code that provides this line item in the form but I am not sure what needs to be modified.
<tr>
<td class="key">
<?php echo JText::_('EB_CANCEL_BEFORE_DATE'); ?>
</td>
<td>
<?php echo JHTML::_('calendar', $this->item->cancel_before_date != $this->nullDate ? JHTML::_('date', $this->item->cancel_before_date, $format, $param) : '', 'cancel_before_date', 'cancel_before_date'); ?>
</td>
</tr>
Any help or pointers would be greatly appreciated. I have a few of these that I am looking to do but this is one that is top on my list.
Thanks for a great product and this great forum and support.
-Brett
I am trying to hard coded a few values in my new event form and was hopeful that somebody might be able to assist.
In this case I want to hard code (or at least default) a value in the Cancel By Date for event registrations.
I have found the code that provides this line item in the form but I am not sure what needs to be modified.
<tr>
<td class="key">
<?php echo JText::_('EB_CANCEL_BEFORE_DATE'); ?>
</td>
<td>
<?php echo JHTML::_('calendar', $this->item->cancel_before_date != $this->nullDate ? JHTML::_('date', $this->item->cancel_before_date, $format, $param) : '', 'cancel_before_date', 'cancel_before_date'); ?>
</td>
</tr>
Any help or pointers would be greatly appreciated. I have a few of these that I am looking to do but this is one that is top on my list.
Thanks for a great product and this great forum and support.
-Brett
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
-
13 years 1 week ago #15399
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Re: How to hard code a value in a new event form
At the top of that file, you can use the code below :
You can do the same for all other fields (note, you will need to know basic php to do that) .
Tuan
Code:
if (!$this->item->id) {
$this->item->cancel_before_date = 'the_value_you_want' ;
}
You can do the same for all other fields (note, you will need to know basic php to do that) .
Tuan
Please Log in or Create an account to join the conversation.
Moderators: Tuan Pham Ngoc
Support
Documentation
Information
Copyright © 2025 Joomla Extensions by Joomdonation. All Rights Reserved.
joomdonation.com is not affiliated with or endorsed by the Joomla! Project or Open Source Matters.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.