Hey
I have this Joomla CMS with a component I need to alter.
There are some fields which will only display on the output page when filled, so I tried making one more. I have copied one of the fields exactly, also in the database table, and just changed the name.
It works just like the previous fields… but only if I start with a number. I would like this field to be letter based and I have no clue where and why it is restricted to numeric entry
There are 2 pages I have modified… one admin.html.php and the other outputpage.html.php.
You will see below two sets of pieces in each code.. one original and one I have modified.
admin:
[code=php]<td width=”150″><?php echo _ALBERGHI_DISTANZANEVE ?>
:</td>
<td class=”small”><input class=”inputbox” type=”text” name=”distanzai” value=”<?php echo $row->distanzai; ?>” size=”10″ maxlength=”255″ />
<?php echo _ALBERGHI_ADMINDISTANZANEVE ?>
</td>
</tr>
<tr>
<td width=”150″><?php echo _ALBERGHI_STRANDTYP ?> :</td>
<td class=”small”><input class=”inputbox” type=”text” name=”strandtyp” value=”<?php echo $row->strandtyp; ?>” size=”10″ maxlength=”255″ />
<?php echo _ALBERGHI_ADMINSTRANDTYP ?> </td>
</tr>
_________________________
$numchk += 1;
$query = “ALTER TABLE `#__alberghi` CHANGE `distanzai` `distanzai` MEDIUMTEXT NOT NULL”;
$database->setQuery( $query );
$database->query();
$err_act[$numchk] = ‘Upgrade’;
$err_num[$numchk] = $database->getErrorNum();
$err_msg[$numchk] = $database->stderr();
$numchk += 1;
$query = “ALTER TABLE `#__alberghi` CHANGE `strandtyp` `strandtyp` MEDIUMTEXT NOT NULL”;
$database->setQuery( $query );
$database->query();
$err_act[$numchk] = ‘Upgrade’;
$err_num[$numchk] = $database->getErrorNum();
$err_msg[$numchk] = $database->stderr();
outputpage:
[code=php]
<?php if ($item->distanzai>0) echo _ALBERGHI_DISTANZANEVE . “:<strong> ” . $item->distanzai ?><?php if ($item->distanzai>0) echo “</strong><br />”; ?>
<?php if ($item->strandtyp>0) echo _ALBERGHI_STRANDTYP . “:<strong> ” . $item->strandtyp ?><?php if ($item->strandtyp>0) echo “</strong><br />”; ?>
______________________________________
<td width=”150″><?php echo _ALBERGHI_DISTANZANEVE ?>:</td>
<td align”left”> <input class=”inputbox” type=”text” name=”distanzai” value=”<?php echo $row->distanzai; ?>” size=”10″ maxlength=”255″ /></td>
</tr>
<tr>
<td width=”150″><?php echo _ALBERGHI_STRANDTYP ?>:</td>
<td align”left”> <input class=”inputbox” type=”text” name=”strandtyp” value=”<?php echo $row->strandtyp; ?>” size=”10″ maxlength=”255″ /></td>
</tr>
database from phpmyadmin:
[code=php]
ALTER TABLE `jos_alberghi` CHANGE `distanzai` `distanzai` MEDIUMTEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL
ALTER TABLE `jos_alberghi` CHANGE `strandtyp` `strandtyp` MEDIUMTEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL
So that´s that… I hope anyone can help
thanks