This forum is no longer open and is for reading/searching only.

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 2

datepicker popup location


  1. jflatham
    Member

    Is there a way to modify the location of the datapicker popup calendar, or to make it "always on top". I am having proplems with the calendar being obscured by an adjacent table to the right of the form.

    Posted 15 years ago #
  2. redityo

    Hi,

    It possible to move the calendar pop up location, to do so you need edit "includes/view-function.php", go to around line 407 ~ 417 you will see these code :

    <script type="text/javascript">
    			Calendar.setup({
    			inputField	 : "element_{$element->id}_3",
    			baseField    : "element_{$element->id}",
    			displayArea  : "calendar_{$element->id}",
    			button		 : "cal_img_{$element->id}",
    			ifFormat	 : "%B %e, %Y",
    			onSelect	 : selectDate
    			});
    		</script>

    you can replace with

    <script type="text/javascript">
    			Calendar.setup({
    			inputField	 : "element_{$element->id}_3",
    			baseField    : "element_{$element->id}",
    			displayArea  : "calendar_{$element->id}",
    			button		 : "cal_img_{$element->id}",
    			ifFormat	 : "%B %e, %Y",
    			onSelect	 : selectDate,
    			position     : [10,60]
    			});
    		</script>

    I add "position : [10,60]" parameter in there, it will set the position with [x,y] coordinate value for your pop up calendar. You can change that value to get best position in your page.

    Anyway maybe you can consider to change the "calendar" button to the left instead on the right. To do this edit "includes/view-functions.php" files and go to around line 376 ~ 378, you will see this code :

    <span id="calendar_{$element->id}">
    	<img id="cal_img_{$element->id}" class="datepicker" src="{$machform_path}images/calendar.gif" alt="Pick a date." />
    </span>

    Move those code to below line 362, exactly bellow this code :

    <label class="description">{$element->title} {$span_required}</label>

    MachForm Support

    Posted 15 years ago #
  3. jflatham
    Member

    Thanks, Redityo, your instructions were spot on. I would also mention for other users' benefit that the position parameters you posted above are in pixels from the upper left corner of the form, not the page itself. With your guidance, my datepicker calendar is now perfectly placed, always visible.

    Posted 15 years ago #
  4. ryanpowell
    Member

    Is it possible to remove the calendar date picker all together? I am using the date field for Date of Birth so it becomes pretty pointless with most of the users being in their 60's.

    UPDATE: Nevermind. I found my answer here. http://www.appnitro.com/forums/topic/disable-calendar?replies=5#post-4285

    Posted 14 years ago #
  5. muhammadyounas
    Member

    How to do this in machform 4.2 to change date picker popup location

    Posted 9 years ago #

RSS feed for this topic

Reply