I am trying to create my first Django AJAX App. I have a template that 
creates a JQuery slider bar. I also have a datamodel which has a 
sliderbarValue entry and a View that writes to it.
 I need to know how to make the Javascript call the View and pass it the 
slider bar value. Here is the template and javascript I have...
 
 {% block external %}
  
{% endblock %}
  
{% block content %} 
  <br></br>
  <p>
    <label for="power">Intensity:</label>
    <input type="text" id="power" style="border:0; color:#f6931f; 
font-weight:bold;" />
  </p> 
  <div id="slider_1"></div>
  <br></br>
  <script type='text/javascript'>
  $(function (){
    $( "#slider_1" ).slider({
      range: "min",
      value: {{ slider1.sliderValue }},
      min: 0,
      max: 100,
      slide: function( event, ui ) {
        $( "#power" ).val(ui.value );
      }
    });
    $( "#power" ).val($( "#slider_1" ).slider( "value" ) );
    return false;
  });
  </script>
{% endblock %}

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to