Want to set up Date Picker

JP

Member
That is exactly what I "thought" I did but obviously missed something because I could not get it to work.

I went back and looked at it some more and I in deed now have it working with an "if" statement for the Save button and it is looking for date_received to already be filled in (disabled), if not then enable the button.

Everything in bold I added.

if (($form_type == "insert" or $form_type == "update")&&($details_row[date_received] != "")) {
$form .= "<tr><td class=\"tr_button_form\" colspan=\"".$number_cols."\"><input disabled=\"disabled\" type=\"submit\" class=\"button_form\" value=\"".$submit_buttons_ar[$form_type]."\"></td></tr></table></form>";
}
else {
$form .= "<tr><td class=\"tr_button_form\" colspan=\"".$number_cols."\"><input type=\"submit\" class=\"button_form\" value=\"".$submit_buttons_ar[$form_type]."\"></td></tr></table></form>";
}
return $form;

And the working result looks like this:

update7.png


Thanks again Debbie for your help :)

Working demo: http://dadabik.kicks-ass.net



Post Edited (05-25-10 03:32)
 

nmcgann

New member
This is such a good thread to resurrect (tu)

I've got a couple of newby observations of quick fixes I had to do to get the jscript calendar popup to work:

Function get_field_correct_displaying in business_logic.php needs pick_date adding as a case so that the dates show in the normal date field format in table displays (e.g. "13 Nov 2010". )

look for this and stick the pick_date case in:
case "insert_date":
case "update_date":
case "date":
case "pick_date":

The jscrip popup has to return the date in yyyy-mm-dd format for search/insert/edit pick_date fields to work properly. There's probably a fix for that somewhere on the forum if I knew the terms to search for it :cool: I might just leave it though as it's ok as-is.

The little calendar icon isn't centered on the input box to the left of it, but adding a style attribute to the <a href where the calendar popup is called is a quick fix.

$form .= " <a style=\"vertical-align: bottom;\" href=\"javascript:NewCssCal........

I know there is a much better fix for this using style sheets (http://www.dadabik.org/forum/read.php?1,11162,11163#msg-11163), but I didn't mind the blue border ;) (I'll probably fiddle with the better solution later, although doing too much customisation on 4.3beta isn't probably a very good idea while it is getting actively developed).
 

JP

Member
Thanks for the additional tips.

Never thought of adding case "pick_date" to get_field_correct_displaying in business_logic.php. I should have added that in one of my original posts for those who may have wanted to show the date in normal date field format in table displays (e.g. "13 Nov 2010". )


The javascript pop up calendar has it's own configuration that allows for displaying the date in different formats. rainforestNET Javascript Date Time Picker.


The style I mentioned in post Remove the blue border around calendar img was for Firefox and I should have included that in my post, my bad. I have a style slightly different for IE7.
 
Top