calendar popup

18 years 3 weeks ago #9041 by mikko
Replied by mikko on topic Re:manually enter the date
You can do that by commenting awayt the code that inserts the calendar and disabled attribute to the field. I do not know how the input validation would go though, but you could try the following.

Edit file administrator/components/com_comprofiler/comprofiler.class.php from line 2216 to 2220 parameters are assigned to the calendar. You can find the documentation and available parameters for the calendar script here : www.dynarch.com/projects/calendar/

Another option is to edit the same file and comment out the jaascript and attribute disabled.

mikko

Please Log in to join the conversation.

18 years 2 weeks ago #9068 by mangoman
Replied by mangoman on topic Re:manually enter the date
I'm a bit confused - excuse my ignorance, but...

I can just delete the code referring to javascript and the "attribute disabled" (whatever that is; now I know - I googled it)??

If I do the first option, then how could I format the birthdate info - that is, correctly get the user's data - in order to properly include/add this info into the database field.

And if I disable the field, it may confuse users - they will see it greyed out and suppose it's not required (which is is). Result: I don't think I'll have users correctly and consistently entering the data. (Option: I can provide a sample instruction such as "yyyy-dd-mm" as part of tthe CB field name).

If there is another way to get this info, then that is what I'm (urgently) seeking ....like another post, my users are incorrectly entering data and I suddenly have a lot of baby users due to birthdates in 2006!

Thanks for the help - let's go further and see how to improve this part of the CB code.

John

Post edited by: mangoman, at: 2006/03/26 21:30

Post edited by: mangoman, at: 2006/03/26 21:31

Please Log in to join the conversation.

18 years 2 weeks ago #9207 by walb
Replied by walb on topic Re:calendar popup
I recognize the problem and made the following modification to file administrator/components/com_comprofiler/comprofiler.class.php line 2085[code:1]$return = '<input class="inputbox" mosReq="'.$oReq.'" mosLabel="'.getLangDefinition($oLabel).'" type="text" name="' . $oName .'" readonly="readonly" id="' . $oName . '" value="' . $oValue . '" />'."\n";[/code:1]
take the readonly out and change it to[code:1]$return = '<input class="inputbox" mosReq="'.$oReq.'" mosLabel="'.getLangDefinition($oLabel).'" type="text" name="' . $oName .'" id="' . $oName . '" value="' . $oValue . '" />'."\n";[/code:1]
Line 2086[code:1]if (!$oReadOnly) $return .= "<script type=\"text/javascript\">\n"[/code:1]To create an image button button, change it to[code:1]if (!$oReadOnly) $return .= '<img src="../components/com_comprofiler/images/calendar.png" id="trigger_i" alt="+" title="' . _UE_DATE_SELECT . '" />' . "<script type=\"text/javascript\">\n"[/code:1]
Insert somewhere between line 2088 - 2092 this line. [code:1]'button : "trigger_i",'
[/code:1]To have a trigger on the image button, I inserted it after 2090. EDIT>> JB dropped a leading point ('.') in the last statement for concatenation.

Now you need to insert an image in components/com_comprofiler/images/calendar.png
I took one from phpmyadmin, which has the right size.

Last step to to control the language.
Add this to your language file components/com_comprofiler/plugin/language/default_language/default_language.php [code:1]DEFINE('_UE_DATE_SELECT','Date select');[/code:1] and add it to other language files, if needed.

If everything is implemented well, it does the following:
  • The date text field is editable
  • It allows to delete any earlier entered date from the field
  • A small button is displayed on the right for date selection at will

It worked for me.
Success

I hope that this code is properly displayed by JoomlaBoard.:dry:

Post edited by: walb, at: 2006/03/28 18:38

Please Log in to join the conversation.

18 years 1 week ago #9593 by mangoman
Replied by mangoman on topic Re:calendar popup
Thanks so much.

I updated the code, and it should make it easier for user registrations & birthdates, but...

I don't get a popup where the calendar icon appears; you can see it here:

www.milk.com.mx/component/option,com_comprofiler/task,registers/

I tried shifting the code around a bit, but still could not get it to work (as a pop up). Any suggestions?

Please Log in to join the conversation.

18 years 1 week ago #9596 by walb
Replied by walb on topic Re:calendar popup
@mangoman,
I looked at your link. Thanks for that!
Take special care of where to put this:
. 'button : "trigger_i",'
I suggest strongly to insert after line 2090 (original line numbering)
At your script it generates now an javascript error.

Brgds,

Walb

Ps. I got it working and it should work for you too. If necessary, I will attach my coding, which also works for multiple date fields. (Slightly changed coding though, due to IE problems not solving correctly multiple date fields)
But it enables me now to generate a staff holiday list.

EDIT>> I removed this ] from the coding. And I don't know how it got in.

Post edited by: walb, at: 2006/04/03 21:16

Post edited by: walb, at: 2006/04/03 21:17

Please Log in to join the conversation.

18 years 1 week ago #9597 by mangoman
Replied by mangoman on topic Re:calendar popup
Yep, I moved it up 2 lines and that fixed it - now it works perfectly.

Thanks again....Now, when we upgrade to CB 1 stable, I'll perhaps have to do this all over again! :woohoo:

John

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.192 seconds

Facebook Twitter LinkedIn