Forums

Custom Input form field Question.

altnetwork 20 Nov, 2008
Hello,

I am looking to find how to create a custom input form field that will a number that is typed and added a two digit year at the front of this and at the end add a 2 char company code.

Format:

08{numbers added by end user}OR

Thanks for any help!!!

Doyle
GreyHead 20 Nov, 2008
Hi altnetwork,

In OnSubmit before put
<?php
$temp = JRequest::getString('field_name', '', 'post);
$temp = "08".$temp."OR";
JRequest::setVar('field_name', $temp, 'post');
?>

Bob
altnetwork 21 Nov, 2008
Thanks, I see how you are doing that and it makes sense.

I need to have the end user select the two digit year. Will the code below work.

field_name_year would be the two digit year from a pull down and the field_name would be the number they would enter into the field.


<?php
$temp = JRequest::getString('field_name_year', 'field_name', 'post);
$temp = $temp."OR";
JRequest::setVar('field_name', $temp, 'post');
?>
Max_admin 21 Nov, 2008
No, it should be :
    <?php
    $temp = JRequest::getString('field_name_year', '', 'post).JRequest::getString('field_name', '', 'post);
    $temp = $temp."OR";
    JRequest::setVar('field_name', $temp, 'post');
    ?>


Regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
This topic is locked and no more replies can be posted.