For the Joomla contact form (using Joomla 3.3.3), you have your required fields and a tooltip that shows if you mouse over the field name. Fx. the field "Name" the tooltip I suppose would show "Your name"
But instead it shows this: "< strong >Name< /strong >< br/ >Your name"?
How to remove the "< strong >Name< /strong > "?
Have tried looking around a bit but haven't really found a solution to this yet. Only how to remove/hide the tooltips, but not how to fix it removing those code strings.
Screenshot of my contact form:
https://www.dropbox.com/s/k4dxsst0u91gcan/Contact%20tooltip%20issue.png?dl=0
Okay figured that the problem is coming from my template.
Tried switching over to the joomla protostart template and test it there, and the tooltip work fine.
So now I need to figure out why it isn't working on the template I'm currently using.
It was a jquery conflict with joomla updates.
Fixed it by editing the var.php in my template with the following changes:
From, (line 7):
JHTML::_('behavior.framework', true);
// disabled sins joomla 3
//JHTML::_( 'behavior.mootools' );
To:
JHtml::_('bootstrap.framework'); // JOOMLA 3.X (LOADS BOOTSTRAP)
JHtml::_('behavior.framework', true);
$doc->addScript($this->baseurl . '/templates/' . $this->template . '/js/jquery_no_conflict.js', 'text/javascript');
// disabled sins joomla 3
//JHTML::_( 'behavior.mootools' );
And removed this on line 28.
// Add JavaScript Frameworks
JHtml::_('bootstrap.framework');
Related
How can i have a link field in a content type display a default text when the field is empty.
For now i have a field as a link - and the link is set to have a static title. This Works fine.
But i'd like to display a default title if the field is empty with no link (but still rendered as a link/button).
It's not a view - so i can't use "rewrite output if empty".
I'm a newbee to drupal - so please help
This shows what I've got so far:
http://1fb72c32b5e90467b795f388746f7501b3ad8021.web9.temporaryurl.org/tmp/link2.PNG
When the link field is empty the button doesn't show. Instead of not showing when empty I'd like it to show someting like this as default:
http://1fb72c32b5e90467b795f388746f7501b3ad8021.web9.temporaryurl.org/tmp/link3.PNG (the button "Bestil på tlf...")
By simply using Link module, i don't think this is possible. But, follow below steps in your environment and i think you might achieve the goal:
Make custom template file for the page (i think, its product details page)
In that template file, check whether the link is empty or not
If link is not empty, show the link. If link is empty, show your custom HTML.
I use https://github.com/CakeDC/TinyMCE to download plugin and did follow all the step to integrate on my cakePHP project. so right now, all the textarea was successfully changed to tinyMCE editor
But when click "SUBMIT" to submit my form, page cannot submit and post data. Without loading editor my form can submit and post data.
Is any jquery problem ? please advise me.
thank you.
Bootsrab.php
CakePlugin::load('TinyMCE');
Configure::write('TinyMCE.editorOptions', array('width' => '500px','height'=>'250px' ));
Controller:
public $helpers=array('Html','Form','TinyMCE.TinyMCE');
View:
$this->TinyMCE->editor(array('theme' => 'advanced', 'mode' => 'textareas'));
echo $this->Form->input('user_requirements',array('required'=>true) );
Layout : default
loding js file:
echo $this->Html->script(array('ddsmoothmenu','jquery-1.7.1.min','jquery-ui-1.8.17.custom.min'));
You've set the field to be required, so the problem you are experiencing is probably the browser based form validation.
The problem is that the validation applies before TinyMCE injects the contents into the textarea, and so the validation will always fail as the textarea is empty. This is a very long known "bug" btw:
http://www.tinymce.com/develop/bugtracker_view.php?id=4768
http://www.tinymce.com/develop/bugtracker_view.php?id=5671
In Firefox you might notice a validation bubble that appears "behind" the browser in the bottom left corner of the screen, and in Chrome for example it would throw the following error: "An invalid form control with name='...' is not focusable".
The quick and dirty fix would be to set required to false. In order to keep the required class on the generated container div you would have to set this manually using the div option:
'div' => array('class' => 'input text required')
It's also possible to disable browser validation completely by defining the novalidate attribute on the form:
$this->Form->create('ModelName', array('novalidate' => true));
or using the formnovalidate attribute on the submit button:
$this->Form->submit('Submit', array('formnovalidate' => true));
Theoretically it would also be possible to listen to the invalid event and display custom validation bubbles, but the problem here is that the browser behavior is not consistent, ie in Chrome it's not possible to validate invisible (using display or visibility) fields. Also the content would still be missing in the textarea field.
What seems to work is using opacity to hide the field, that way one could position the textarea under the editor, and the validation bubble would be displayed correctly. However that would also require to inject the editor contents in the textarea manually when pressing Enter and when clicking the submit button (or probably even simpler using proper editor change events). I'll see if I can come up with an example for this later on.
Update: I've implemented a fix/workaround in form of a TinyMCE 4.x plugin, as this was bugging me in some of my own applications too, see https://github.com/ndm2/tinymce-validatable
I want to make a simple use of the plugin x-editable, following step by step what's to do in the official doc.
It actualy worked fine when I was on Bootstrap 2, though, it doesn't work anymore on BS3 (even if I updated everything to the latest version etc.).
So when I click on the link to trigger the editable popover, I got this error in firebug :
TypeError: this.$element.data(...) is undefined
[...]/Bootstrap3/js/bootstrap-editable.js
Line 154
Which is actually this line :
this.$element.data('popover').tip().addClass('editable-popover');
Btw, I'm using CakePHP, all the plugins (js and CSS) are declared etc...
So I'm running out of idea, if someone knows about it, would be cool !
Thanks !
EDIT : Problem solved, just had to reload the cache... Old script was still in it so there was compatibility problems.
Did you download the latest Bootstrap 3 ready version from: http://vitalets.github.io/x-editable/assets/zip/bootstrap3-editable-1.5.0.zip
I didn't find any problem following the steps from http://vitalets.github.io/x-editable/docs.html. See: http://jsfiddle.net/xaRbU/
Note the examples use jquery-2.0.3 (the fiddle above works with 1.9.1). Since jQuery 2 doesn't support IE8 Bootstrap requires the newest 1.x version of jQuery, see also: Updating Bootstrap to version 3 - what do I have to do?
Code used:
html:
<div class="container">
<div class="row">
superuser
</div>
</div>
javascript:
$(document).ready(function() {
$('#username').editable();
});
css:
/* create some space cause the popup shows on the top of the element */
body{padding-top:100px;}
I'm using Selenium Webdriver to test a web page.
The web page http://www.leaseplan.nl/contact/index.asp has two buttons, one button with button text 'Zoeken' and one with button text 'Verstuur'. I want to click on the button with button text 'Verstuur' either by using XPath or CssSelector with the following code:
driver.FindElement(By.XPath("/html/body/div[3]/div[2]/div[2]/form/fieldset/a/span")).Click();
driver.FindElement(By.CssSelector("fieldset.contact_form > a.button > span.button_center")).Click();
But using the either one of the above lines of code, on the button with text 'Zoeken' is clicked on instead.
This button has quite a similar CssSelector and XPath:
fieldset.header_search a.button span.button_center
/html/body/div[3]/div/form/fieldset/a/span[2]
Does anybody know how to solve this?
Try this out with the cssSelector and tell me if it's work.
For "verstuur" :
By.cssSelector("div.content form a.button")
Solution :
Ok, i've found your problem. Your xpath is good but now, your action on the click submit the first form, so the form with "Zoeken".
onclick="document.forms[0].submit();" // submit the 1st form, the bad one !
Try this :
onclick="document.forms["form"].submit();" // submit the 2nd form, the good one !
//or
onclick="document.forms[1].submit();"
proof : Jsfiddle
xpath for ZOEKEN /html/body/div[3]/div/form/fieldset/a/span[2]
xpath for VERSTUUR /html/body/div[3]/div[2]/div[2]/form/fieldset/a/span[2]
Try this:
driver.FindElement(By.XPath("//span[text()='Verstuur']")).click();
Edit:
I think you want to learn Selenium that's why you are using 3rd party websites. If you really want to learn Selenium find some opensource applications to automate. Here is a good application to automate -
http://sourceforge.net/projects/sugarcrm/files/1%20-%20SugarCRM%206.5.X/FastStack/
Download the latest version and install.
Find more info about the website and selenium stuff here. It's so good..
http://selftechy.com/2011/02/05/introduction-to-selenium-web-application-test-automation-tool
Zoeken: driver.findElement(By.xpath("//div[1]/form/fieldset/a/span[2]")).click();
Verstuur : driver.findElement(By.xpath("//div[2]/form/fieldset/a/span[2]")).click();
Using xpath is easy but slow.
These are my first steps with drupal.
I have created a taxonomy hierarchy for my articles and now I am trying to add a new field to the content type "Article" and "Media" so the content admin can assign a "category" to his new content.
So I've been to Structure > Content Types > Article > Manage Fields
Then "Add new field" with :
1- Label = Category
2- Name = "field_category
3- Field = "Term reference"
**4- Automatically changes to "Select list" but I am unable to see the drop down list options. Clicking the list doesn't do anything, I couldn't select Autocomplete or any other value I've seen on forums & tutorials. Using firebug I could see the options are there, but the list doesn't show up.**
This is happening with all types of fields, even with text fields, the most basic one.
Any idea why is this happening ?
As glumbo mentioned, the problem here is caused by jQuery 1.7 update. As of jQuery 1.6 DOM properties should be accessed using .prop() function.
There is an open issue with some hotfix solution:
You need to replace .attr() jQuery function call with .prop() in /modules/field_ui/field_ui.js at following lines:
100: $(this).html(html).attr('disabled', disabled ? 'disabled' : '');
253: $(ajaxElements).attr('disabled', true);
Please note that this fix modifies a Drupal core module and you'll probably want to use a patch (Dries would kill the kitty anyway:).
The problem is with jquery update. If you are using jquery 1.7 you will get this problem