Hi Melvyin still not working
$(".captcha_form").submit(function(event){
event.preventDefault();
var form = $(this)
alert (form.serialize())
$.ajax({
type: "POST",
url: "./captcha",
contentTy
Hi Melvyn
thanx a lot . I will try tomorrow early morning and will let u know. Thanx.
valerio
On Monday, March 27, 2017 at 3:31:38 PM UTC+2, Melvyn Sopacua wrote:
>
> Hi,
>
>
>
> {% if field.name = 'captcha' %}
>
>
>
> assigns 'captcha' to field.name and returns if that succeeded. So it's
Hi,
{% if field.name = 'captcha' %}
assigns 'captcha' to field.name and returns if that succeeded. So it's always
true. You
probably mean:
{% if field.name == 'captcha' %}
>From what you describe, testfield shows up and your template code says it
>shouldn't
show up.
However, when debugging
testfield is where i type my captcha, sorry
On Monday, March 27, 2017 at 2:38:15 PM UTC+2, valerio orfano wrote:
>
> Hi Melvyn thanx for ur reply,
>
> this is my form.
>
> class AjaxForm(forms.ModelForm):
> captcha = CaptchaField()
> class Meta:
> model = ajaxModel
> exclud
Hi Melvyn thanx for ur reply,
this is my form.
class AjaxForm(forms.ModelForm):
captcha = CaptchaField()
class Meta:
model = ajaxModel
exclude = []
class ajaxModel(models.Model):
testfield = models.TextField(null=True, blank=True)
If i don't use a ajaxmodel a get an
On Monday 27 March 2017 04:46:06 valerio orfano
wrote:
> {% if field.name = 'captcha' %}
It may not make a difference if you only have one
visible field, but this is not a comparison.
--
Melvyn Sopacua
--
You received this message because you are subscribed to the Google Groups
"Django users
btw this is my html:
{%csrf_token%}
{{ form.non_field_errors }}
{% for field in form.visible_fields %}
{% if field.name = 'captcha' %}
{{field}}
{% endif %}
{{ field.errors }}
{% endfor %}
{% for field in form.hidden_fields %}
{{ field }}
Hi Andreas thak you very much.
I've changed my html with the following:
$(document).ready(function(){
$.ajaxSetup({
beforeSend: function(xhr, settings) {
function getCookie(name) {
var cookieValue = null;
if
You Ajax call have a suspicious "data: {}" in the middle of all the
arguments.
On 27 Mar 2017 10:23 am, "valerio orfano" wrote:
Hi, I managed to make an ajax call. But the form is always invalid. IT is
like the captcha field passed to the view is always empty.
valerio
On Monday, March 27, 201
Hi,
First of all - you are not sending anything to the form.
$.ajax({
type: "POST",
url: "../captcha",
contentType: "application/json",
data: {},
dataType: "json",
success: function(data) {
Hi, I managed to make an ajax call. But the form is always invalid. IT is
like the captcha field passed to the view is always empty.
valerio
On Monday, March 27, 2017 at 8:48:17 AM UTC+2, valerio orfano wrote:
>
> I have the following class view taken from documentation:
>
> class CaptchaView(Cr
I have the following class view taken from documentation:
class CaptchaView(CreateView):
template_name = "captcha.html"
form_class = MyForm
def form_invalid(self, form):
if self.request.is_ajax():
to_json_response = dict()
to_json_response['status']
12 matches
Mail list logo