 |
 |
|
Junior Member
|
Status: Offline
Posts: 12
Join Date: Aug 2007
|
|
I've been using PHPMagic Professional v3.0 for a few months now to build some very nice front ends for my databases. Now, however, I have to build one that has numerous date fields that have to be filled in at different times during our business process. If I just used the generated code, I end up with several fields defaulting to todays date - most of which have to be cleared out before saving the record. Then, when the record is opened again later they have to search through the drop downs to find a date, which is tedious. So I have two questions:
1. What is the best method for turning off the default date in a date field? I've been going into mydatabase_dml.php and changing DefaultDate = date("Y-m-d") to DefaultDate = date(""). That works, but seems a little awkward. I also modify MinYear = 1900 to say MinYear = 2007. I'm a little surprised that this can't be modified in the PHPMagic front end - it seems kind of obvious to me, but perhaps
2. Is there a way to embed a pop-up calendar instead of the individual drop downs in the exploded fields. I've seen a number of nice javascripts that do this kind of thing, but I can't figure out how to use them in the templates generated by PHPMagic.
Thanks for any help you can give me!
|
|
|
|
 |
 |
|
Senior Member
|
Status: Offline
Posts: 266
Join Date: Mar 2005
Location: San Fran, CA
|
|
2) I have used the calendar script here
It was not bad to setup. I simply added the javascript to the generated blank header.php file. And added the form code to launch the calendar in the generated tablename_dv_template file. Something like that, it's been a while ago.
|
|
|
|
 |
That's exactly where I'm stuck
 |
 |
 |
|
Junior Member
|
Status: Offline
Posts: 12
Join Date: Aug 2007
|
|
Ironicly, the "something" is where I'm stuck. I'd found the same javascript and thought I was golden. I copied the header stuff into header.php and then edited myDatabase_templateDV.html and the data entry field did show up, but the data doesn't pass properly. for example, one of my fields is 'Initial_Contact' which is the simplest, because it defaults to "today". The cell with the original code from PHPMagic looks like this:
<tr>
<td class=TableHeader valign=top>
<div class=TableHeader style="text-align:right;">Initial Contact</div>
</td>
<td class=TableBody width=300>
<COMBO(Initial_contact)%%>
</td>
</tr>
Which I've modified to look like this:
<tr>
<td class=TableHeader valign=top>
<div class=TableHeader style="text-align:right;">Initial Contact</div>
</td>
<td class=TableBody width=300>
<script>DateInput('Initial_contact', true)</script>
</td>
</tr>
The Jason's Date Input Calendar stuff shows up perfectly, but when I enter the data it doesn't show up on in the database. Obviously I'm missing something, but I have no clue what.
|
|
|
|
 |
 |
|
Junior Member
|
Status: Offline
Posts: 12
Join Date: Aug 2007
|
|
A coworker pointed out that I left out the input statement code. He's right, but we can't figure out how to formulate it.
Thanks for any help,
Carl
|
|
|
|
|
Senior Member
|
Status: Offline
Posts: 266
Join Date: Mar 2005
Location: San Fran, CA
|
|
Check the date field format matches Y-m-d or whatever the calendar is using.
If that don't work make the field VarChar with a length of 8 minimum.
|
|
|
|
|
Junior Member
|
Status: Offline
Posts: 12
Join Date: Aug 2007
|
|
We've tried tried several formats and also tried changing to varchar, but we still can't get the control linked to the field. Could you possibly show us a snipit of the TemplateDV where it's actually working? I think we could figure out what's wrong from that.
Thank you,
Carl
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Hybrid Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 08:08 PM.
|
 |
 |
|
|