code for loadig re-captcha plugin in joomla 2.5 - plugins

I want to add default re-captcha plugin to my joomla website.
I write the following code:
//php code
JPluginHelper::importPlugin('captcha');
$dispatcher = JDispatcher::getInstance();
$dispatcher->trigger('onInit','dynamic_recaptcha_1');
//html code
<div id="dynamic_recaptcha_1"></div>
But nothing is displayed!! I tried to find a lot but couldnt get a solution. Any help will be appreciated. Thn.

Have you enabled the captcha plugin in extensions->plugins?
You will also have to fill in the private and public keys in the plugin.

You could try adding client-side validation to your form.
http://docs.joomla.org/Client-side_form_validation
e.g.
JHTML::_('behavior.formvalidation');
<form class="form-validate"> ... </form>
<field name="email" type="text" class="required validate-email" size="30" />
//For radios make sure the class is applied to the options:
<field name="ThisorThat" type="radio" label="Please say if it was full-time or the part-time equivalent?" >
<option value="This" class="required">This</option>
<option value="That" class="required">That</option>
</field>
Then as long as you have ReCaptcha selected as your default Captcha in your Global config it should show up.
Let me know if it works!

Joomla often uses MooTools library.
Try to insert again
<script src="/media/system/js/mootools-core.js" type="text/javascript"></script>
<script src="/media/jui/js/jquery.min.js" type="text/javascript"></script>
<script src="/media/jui/js/jquery-noconflict.js" type="text/javascript"></script>
<script src="/plugins/captcha/idcaptcha/idcaptcha.js" type="text/javascript"></script>
before
<div id="dynamic_recaptcha_1"></div>

Related

Autocomplete on TextArea not respected

This is pretty bizarre, but according to the MDN docs autocomplete has wide-spread support for TextArea element (given that the listed requirements are met):
https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete
But it doesn't seem to work, at least not in either Chrome or FireFox.
This is an example of what doesn't work:
<html>
<body>
<form action="index.html" method="post">
<input type="first" name="input" id="a" autocomplete="on"><br> <!-- Works! -->
<textarea name="second" id="b" autocomplete="on"></textarea><br> <!-- Doesn't work!-->
<input class="submit" type="submit" value="Submit">
</form>
</body>
</html>
So this begs the question: has there been an actual regression in two major browsers, or are the MDN docs wrong? ... or am I missing something entirely different?
Turns out it currently isn't supported from what I can tell: https://www.chromestatus.com/feature/5680387573415936

Twitter's Bootstrap Form Validation [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How to use Twitter Bootstrap popovers for jQuery validation notifications?
Trying to use bootstrap's styles for form validation.
I'm using this javascript validator, that was customized for bootstrap:
https://github.com/ddarren/jQuery-Live-Form-Validation-For-Twitter-Bootstrap
In the head:
<link href="bootstrap.css" rel="stylesheet">
<script src="jquery.validate.js" type="text/javascript">
In the body:
<form id="Form" action="" method="post">
<div class="control-group">
<input type="text" class="span3" id="Mobile" placeholder="Mobile
Phone Number" name="Mobile">
</div>
<div class="control-group">
<button type="submit" class="btn btn-primary btn-large">Submit
</button></p>
</div>
</form>
And it doesn't highlight the fields with bootstrap's error styles. Any ideas where I'm going wrong? Thanks in advance.
I'm working on something similar so I think I might help you.
First of all, jQuery-Live-Form-Validation-For-Twitter-Bootstrap library is quite old (September of 2009).
It uses version 1.3.2 of jQuery (the newest is 1.7.1) and it doesn't use the original Bootstrap files at all!
If you downloaded jQuery-Live-Form-Validation-For-Twitter-Bootstrap (what I am sure you did) from github site you can easily check in css folder that there are two css files written by the author of that library.
Answering to your question, I downloaded that lib and I've pasted your code and... it works. Simply, you need to have in head this (and that files in folders):
<link rel="stylesheet" type="text/css" href="stylesheets/jquery.validate.css" />
<link rel="stylesheet" type="text/css" href="stylesheets/style.css" />
<script src="lib/jquery/jquery-1.3.2.js" type="text/javascript">
</script>
<script src="javascripts/jquery.validate.js" type="text/javascript">
</script>
what is originally taken from jQuery-Live-Form-Validation-For-Twitter-Bootstrap.
If you really want to have Twitter Bootstrap form validation with jQuery I would like to recommend you using combined Twitter Bootstrap and jQuery Validation Plugin.
I am working on it now and it works perfectly.

Tumblr: Search returning no search results

I'm new to tumblr and am trying to implement Search in a custom theme. I have:
<form action="/search" method="get" id="search-form">
<input type="text" name="q" class="query" value="" />
<input type="submit" value="Search" class="submit" />
<div class="clear"></div>
</form>
I have about a dozen posts. Whenever I search for anything in any post, Tumblr always returns no search results. I feel like I'm missing something. Am I to implement or set any configuration anywhere else in the theme? What else is needed to implement search in a user's Tumblr theme?
Thanks!
Here's the solution I use. Put this into the <head> of your code:
<script type="text/javascript">
<!--
function handleThis(formElm)
{
window.location="/tagged/"+formElm.number.value+"";
return false;
}
-->
</script>
And place this where you want the search box to appear:
<form onsubmit="return handleThis(this)">
<div class="submit"><input type="submit" value="{lang:Search}" name="Submit"/></div>
<div class="input"><input onfocus="this.value=''" onblur="if(this.value=='') this.value='Search. Then hit enter.';" type="text" value="{lang:Search}. Then hit enter." name="number"/></div>
</form>
Use CSS to style as you wish. This will search your tags only, but unlike the regular Tumblr search it works.
I was getting no results when my blog was password protected. I removed the password protection from Tumblr Dashboard > settings > blog name > password and it started returning results again.

I need help with forms submit, please read for details

I would like to create a form where the user can put a number in like "12345" and when the submit button is clicked have the result be http://www.URL.com/12345
Do you need that data to be posted somewhere, or do you just want to jump to that location?
You could try without a form:
<label for="number">Number: </label>
<input type="text" id="number" /><br />
<input type="button"
onclick="window.location='http://www.URL.com/'+document.getElementById('number').value;" />
Here's the jQuery version separating the events from the markup. Demo can be seen here
<html>
<head>
<script type="text/javascript" src="jquery-1.4.2.js"></script>
<script>
var url="http://www.url.com/";
$(document).ready(function(){$("#go").click(function(){
url+=$("#parameter").val()
window.location=url;
});
});
</script>
</head>
<body>
<input type="text" id="parameter"/>
<button id="go">Go</button>
</body>

Help required regarding Zend_Form

I wanted following output from Zend_Form please help
<form ...>
<div class="labels"><b>Name:</b></div>
<input type="text" value="" name="name" class="whitelabelform"><br>
<div class="labels"><b>Email:</b></div>
<input type="text" value="" name="email" class="whitelabelform"><br>
<div class="labels"><b>Security code:</b></div>
<div id="recaptcha_cs_fix">
<script type="text/javascript" src="http://src"></script></div>
<div id="submitbtn"><input type="image" alt="Submit Button" src="submit_button.png">
<input type="hidden" value="true" name="submitted"></div>
</form>
Watch this presentation, and you will manage to get any markup of Zend Form you need:
Leveraging Zend_Form Decorators
I won`t code it for you but I can point you to a tutorial about Zend_Form. Its very easy to create what you seek take a look at it.
After you have tried if it doesnt work ask again, posting your code and we will help you fix it.
You can have a form class which your elements are created there and call it in the php (zend view / .phtml file) using something like:
<?php echo $this->form->myformelement; ?>
provided that your controller also assigns the form created to the variable named "form".