X-Editable Datepicker / Bootstrap 2 not using default date - datepicker

This is specifically about x-editable with bootstrap 2.3.2 http://vitalets.github.io/x-editable/
The x-editable selector class is 'xedit'
<strong>01/01/1970</strong>
This code opens the popup datepicker OK, but it doesn't read / use the default value 01/01/1970. Using data-value="01/01/1970" doesn't help either, nor removing the <strong> tags. Once a new date is selected / set, it works fine.
Anyone experienced similar / can suggest why this doesn't work ?
TIA

The <strong> tags do make a difference. Put them outside of your <a> tags. Also, update either your value 01/01/1970 to 01/1/1970 to reflect your data-format and data-viewformat or vice versa.

Related

Modify images_upload_url dynamically on TinyMCE?

I'm trying to pass a parameter on the URL provided in images_upload_url.
This parameter changes depending on a field on the page. (A date input)
Is there any way I can set the value of images_upload_url dynamically on TinyMCE?
Ok, so I ended up removing and initializing TinyMCE again.
function onChangeInput(){
tinymce.remove();
initEditor();
}
Not beautiful but it works just fine :)

Strip wicket tags, but keep wicket attributes

I'd like to strip special Wicket tags (e.g. wicket:panel, wicket:child, etc.) from the output in development mode, but keep the wicket:id attribute.
In the WebApplications init one can set getMarkupSettings().setStripWicketTags(true); thus removing the special tags and attributes.
Is it possible to extend / modify Wicket at some point to keep the attribute when stripSpecialTags is set to true?
This is not possible at the moment.
Please file a ticket for improvement at https://issues.apache.org/jira/browse/WICKET!
Thank you!
Why do you want to keep the wicket:id attribute? For testing/selenium? Then you can use the DebugSettings::setComponentPathAttributeName method to output the wicket component path, which is usable in selenium.

Change the ID of a standard TYPO3 mailform

Every Form object created in TYPO3 has the ID "mailform".
<form action="thanks/" id="mailform" name="mailform" enctype="multipart/form-data[...]
This seems to be a problem since I have 2 forms on 1 page, and when (I think) the IDs are the same, the validation script doesn't work.
As reported here: http://lists.typo3.org/pipermail/typo3-english/2006-April/024467.html
in your main template setup field add this code:
tt_content.mailform.20.formName >
now every mailform will have a different unique (a hash) form id
Use the form extension (system extension since TYPO3 4.6, see the release notes).
You can define an individual id in the tab Form.
1) Look into the Extension files.. maybe you can change it somewhere there easyily.
2) Is it possible for you to change the id maybe via javascript/jquery?
maybe it helps you fix the problem with the validation script:
$('#mailform').each(function(index,value){
index++;
$(this).attr('id', 'mailform'+index);
});

How do I set the maskededitvalidator MinimumValue property to today?

I am using an AJAX Control Toolkit: 'maskededitvalidator' to validate a textboxe's date entry. I am trying to set the minimum value programatically to today's date. I have tried both adding it to the source (and calling Page.DataBind()) or setting it in the code behind and niether work. No error, just the validation does not work. If I change the 'MinimumValue' property to a hardcoded value it works just fine. Any ideas? Thanks!
In the source directly on the control:
MinimumValue='<%# DateTime.Now.Date.ToString %>'
In the server code:
Me.txtDateMEV.MinimumValue = DateTime.Now.ToShortDateString()
I think this is more likely a "calendar" issue than a "maskedit" one.
Maybe you should try some Calendar option just like the example on Calendar Example. Check out the Calendar with date range, it looks like the problem you have.
I was never able to get the binding systax working in the source, but I did get it working in the code behind like below:
Me.txtDateMEV.MinimumValue = DateTime.Now.ToShortDateString()
I had a CSS style which was erasing the current date if it was left blank and did not have a default date set. Once I updated the CSS not to set 'display:none' for the .AJAXCalendar .ajax__calendar_today style, then the code above worked. So half fixed my issue because CSS was preventing the MinimumValue code to apply. However I really wanted to be able to use the binding syntax but I could never get it to work.

Line breaks in Zend Navigation Menu labels

I have a need to create a <br/> tag in the display label for a menu item generated using Zend_navigation, but don't seem to be able to find a way to do so.
My navigation item is defined in the XML config as:
<registermachine>
<label>Register your Slitter Rewinder</label>
<controller>service</controller>
<action>register</action>
<route>default</route>
</registermachine>
I want to force a tag in the output HTML between 'your' and 'slitter', such that it appears on two line as below:
Register your
Slitter Rewinder
However, I can't seem to do it. obviously using in the XML breaks parsing, and using html entities means that the lable is displayed as:
Register your <br/>Slitter Rewinder
Has anyone had experience of this that can offer advice?
Thanks in advance!
there is no such option built-in you have to use a partial
$partial = array('menu.phtml', 'default');
$this->navigation()->menu()->setPartial($partial);
echo $this->navigation()->menu()->render();
http://framework.zend.com/manual/en/zend.view.helpers.html#zend.view.helpers.initial.navigation.menu
you may also try a hack with <label><![CDATA[Menu label<br/>Second line]]></label>
I found a (hacky) solution:
I updated my navigation.xml to use {br} tokens wherever a <br/> tag is required, and then amended the base Zend/View/Helper/Navigation/Menu.php file as follows:
within htmlify function, changed
$this->view->escape($label)
to
str_replace("{br}", "<br/>", $label)
I could (and probably will) override the Zend Library Menu View Helper with my own at some point, but this at least cover it for now.
there is a escapeLabels boolean used to convert html tags and it's true by default.
You can set your navigation like this
$this->navigation()
->menu()
->escapeLabels(false)
->...
http://framework.zend.com/apidoc/2.0/classes/Zend.View.Helper.Navigation.Menu.html#escapeLabels