TOPIC:

Calendar-Value max_possible_value=today 7 months 4 weeks ago #252995

  • Eddy.vh's Avatar
  • Eddy.vh
  • Offline
  • Ultimate Breezer
  • Ultimate Breezer
  • Posts: 663
  • Karma: 4
  • Thanks: 112
Hi,

Simply add the 'readonly' attribute to the calendar input.
  JQuery("#ff_elem171").attr('readonly', true);  // make the input readonly                      

mfG,
Eddy

Please Log in or Create an account to join the conversation.

Last edit: Post by Eddy.vh.

Calendar-Value max_possible_value=today 7 months 3 weeks ago #253116

  • Topic Author
  • Mister.Miracle
  • Offline
  • Senior Breezer
  • Senior Breezer
  • Posts: 135
  • Karma: 1
  • Thanks: 1
The problem:

if i enter it to the form-editor - fieldname - Inhalt:
JQuery("#ff_elem171").attr('readonly', true);
then the result only it the button gets the lable "JQuery("#ff_elem171").attr('readonly', true);"

if i enter it to the formname - extended option - more options - Formularteile - Vor Formular
$this->execPieceByName('ff_InitLib');

echo '
<script type="text/javascript">                                        
	JQuery("#ff_elem171").attr('readonly', true);
    JQuery(document).ready(function () {                             
        JQuery("#ff_elem171_calendarButton").pickadate({
			format: "dd.mm.yyyy", 
			max: "+0d",
			onSet: function() {JQuery("#ff_elem171").val(this.get("value"));}
		});
        });
</script>
';
i got in frontend of Joomla an error:
Bei Problemen ist der Administrator dieser Website zuständig.

0 syntax error, unexpected 'readonly' (T_STRING), expecting ';' or ','

if i change the code to
JQuery("#ff_elem171").attr("readonly", "true");
then the field will not be disabled, so i should only choose the value by the button.

Thank you for your help

Please Log in or Create an account to join the conversation.

Calendar-Value max_possible_value=today 7 months 3 weeks ago #253122

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 6888
  • Karma: 3
  • Thanks: 492
Hi,

you can make it readonly on this way:
go to your form->Advanced->More options->Scripts->Init.script->check Custom and put this:
function ff_nameofyourform_init()
{
ff_getElementByName("nameofyourcalendar").readOnly=true;
} // ff_nameofyourform_init
Please replace nameofyourform with name of your form (not title), and nameofyourcalendar with name for your calendar (not title).

Regards,
Tihana

Please Log in or Create an account to join the conversation.

Calendar-Value max_possible_value=today 7 months 3 weeks ago #253125

  • Eddy.vh's Avatar
  • Eddy.vh
  • Offline
  • Ultimate Breezer
  • Ultimate Breezer
  • Posts: 663
  • Karma: 4
  • Thanks: 112
Hi,
Tihana's code also works, both work, at least for me, I gave the jQuery formula because you started with this type of code.

Regards,
Eddy

Please Log in or Create an account to join the conversation.

Calendar-Value max_possible_value=today 7 months 3 weeks ago #253127

  • Topic Author
  • Mister.Miracle
  • Offline
  • Senior Breezer
  • Senior Breezer
  • Posts: 135
  • Karma: 1
  • Thanks: 1
yes thought it, that it would work, but if i write it to the end of you other code.

on which position i have to code it.
like the way i have done, it dont work fine :-(

Therefore, i asked again.

if i google it, i got the same result as your code, therefore i wondered.

thank you to both for helping till now

Please Log in or Create an account to join the conversation.

Calendar-Value max_possible_value=today 7 months 3 weeks ago #253129

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 6888
  • Karma: 3
  • Thanks: 492
Hi,

like this:
$this->execPieceByName('ff_InitLib');

echo '
<script type="text/javascript">                                        
    JQuery(document).ready(function () {                             
        JQuery("#ff_elem171_calendarButton").pickadate({
			format: "dd.mm.yyyy", 
			max: "+0d",
			onSet: function() {JQuery("#ff_elem171").val(this.get("value"));}
		});
        });
</script>
';

And in form->Advanced->More options->Scripts->Init script->custom:
function ff_nameofyourform_init()
{
ff_getElementByName("nameofyourcalendar").readOnly=true;
} // ff_nameofyourform_init

I tested it and it works ok

Regards,
Tihana
The following user(s) said Thank You: Mister.Miracle

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
  • 2
Moderators: ForumSupport
Time to create page: 0.054 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

September Discount!

Massive discounts on all subscriptions!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!