Ok, starting over on my little simple form, and still no clue as to why I can't get my variable stored in the database.
I have created a form with a series of fields.
One of them is 'year-week day', and I've given instructions that it should have a format of '11-49 Ons'.
I would like to control the formatting a bit closer thus split it to three fields:
year (number with two digits)
week (number with two digits)
day (selext box).
Then concat the three fields to one, and store the concat'ed value in the db.
I've created a hidden field (ugedagtekst) for the concat'ed value, as I suspect that is necessary to accomplish this.
So, with much help from Bob, I've created the small piece of code:
The variable ugedagtekst is created correctly, but I don't see anything stored in the database this way (either).
I have created a form with a series of fields.
One of them is 'year-week day', and I've given instructions that it should have a format of '11-49 Ons'.
I would like to control the formatting a bit closer thus split it to three fields:
year (number with two digits)
week (number with two digits)
day (selext box).
Then concat the three fields to one, and store the concat'ed value in the db.
I've created a hidden field (ugedagtekst) for the concat'ed value, as I suspect that is necessary to accomplish this.
So, with much help from Bob, I've created the small piece of code:
<?php
$year = JRequest::getVar('year', 0, 'post');
$week = JRequest::getVar('week', 0, 'post');
$day = JRequest::getVar('day', 0, 'post');
$ugedagtekst = $year. '-' .$week. ' ' .$day;
echo 'UgedagTekst:"'.$ugedagtekst.'"';
$from->data['ugedagtekst'] = $ugedagtekst ;
?>
The variable ugedagtekst is created correctly, but I don't see anything stored in the database this way (either).
SOLVED - Finally found the problem.
The previous code-advice said 'From' and not 'Form'!
So changing that made it save it, weehee
The previous code-advice said 'From' and not 'Form'!
So changing that made it save it, weehee
Hi fribse,
Apologies for my typo - spell-check doesn't catch that one :-(
Bob
Apologies for my typo - spell-check doesn't catch that one :-(
Bob
This topic is locked and no more replies can be posted.