11 years ago
2
Topic

Hi,

I've created a form with Calendar (Date) field to enter a date and this field is not Mandatory.

A person clicked on the Calendar ICON and entered a date. 

Now, I want to clear the date from that field and want to have empty value.


How to do this?  Please some one help me.


Regards,

kacraj.

Get a VIP membership
11 years ago
0
Level 1

Hi All,

I found the code where i need to edit. please someone check and let me know how to go about.

/plugins/ccs_field/calendar/calendar.php

On line 114

[code]

$form     =   '<input class="inputbox text '.$required.$validation.'" type="text" id="'.$id.'_hidden" name="'.$name.'_hidden" readonly="readonly"'

[/code]


1. first thing is removing "readonly"

2. changing the value of this field on keyup to the value of the hidden field. This hidden field can be seen in line 106.


Can anyone please help me to solve this issue?

11 years ago
0
Level 1

Hi All,

At last I found a way to solve this issue. Please replace the code in 114

plugins/cc_field/calendar/calendar.php

$form     =   '<input class="inputbox text '.$required.$validation.'" type="text" id="'.$id.'" name="'.$name.'" '
           .   ' maxlength="'.$field->maxlength.'" size="'.$field->size.'" value="'.$value.'" '.$style.' onchange="document.getElementById(\''.$id.'_hidden\').value=document.getElementById(\''.$id.'\').value" />';


Regards,

kacraj.

Get a Book for SEBLOD