hi
thanks for the link.
I tried this,In firefox3.6.11 ,it is rendered as a text field
In chrome it shows a slider.
...
<p>
<label for="id_user_entry">select numerical value using slider:</
label>
<input type="range"
min="0"
max="1000"
step="2"
value="6" id="id_user_entry"/>
</p>
<p>
{{myform.user_entry.errors}}
</p>
...
However,I am getting validation error upon processing the form
I put the field as an IntegerField in my model .I am not sure if that
is ok.
class MyModel(django.models.Model):
user_enrty=models.IntegerField()
class MyModelForm(django.forms.ModelForm):
class Meta:
model=MyModel
In the view ,I checked for validity of form
...
form_data=get_form_data(request)
form=MyModelForm(form_data)
if request.method=='POST':
print 'request.POST=',request.POST
form_is_valid=form.is_valid()
print 'form is valid:',form_is_valid
if form_is_valid:
newentry=form.save()
print 'newentry=',newentry
return redirect('home')
else:
print 'form is not valid'
...
Chrome complains that the slider field is required .The request.POST
is printed without the 'user_entry' key
I tried the same with firefox(which rendered the slider as textbox)
There also I get 'field is required error'
Any idea how I can correct this? Why do the data in input
type="range" not coming in the request.POST querydict?
thanks
jim
On Oct 26, 7:11 pm, ringemup <[email protected]> wrote:
> Try the HTML5 <input type="range">. On some current browsers, it'll
> just appear as a text field, although you can supplement it with
> javascript. Moving forwards, as more browsers support HTML5 forms,
> it'll appear as a slider widget. See [1].
>
> [1]http://diveintohtml5.org/forms.html#type-range
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.