Database Forum
Web Database Register Members List Calendar FAQ

 
Go Back   Database Forum > PHPMagic Discussions > Customization
User Name
Password

Reply
 
Thread Tools Search this Thread Display Modes
Default Date Field Problem
02-22-2008, 08:48 AM #1  

lost2ny
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!
Reply With Quote

Default
02-22-2008, 04:48 PM #2  

clifford
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.
Reply With Quote

Default That's exactly where I'm stuck
02-25-2008, 07:48 AM #3  

lost2ny
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)%%> &nbsp;&nbsp;
</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> &nbsp;&nbsp;
</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.
Reply With Quote

Default Correction
02-25-2008, 09:06 AM #4  

lost2ny
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
Reply With Quote

Default
02-27-2008, 04:04 AM #5  

clifford
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.
Reply With Quote

Default still struggling
03-05-2008, 09:22 AM #6  

lost2ny
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
Reply With Quote

Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump



All times are GMT -5. The time now is 08:08 PM.

Powered by: vBulletin Version 3.7.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Database Forums

Help support our forum assistants and product development ->

go to top go to top