Hi,
i am having some trouble with my date picker. I probably missing someting,
the form fields are displaying fine, but some how the datepicker is no
displaying. probably something to do with my jquery. Please help

models.py
class foreginexchange(models.Model):
    Sold_deal_number=models.CharField(max_length=45)
    Value_date=models.DateField()
    Vatu_equivalent=models.CharField(max_length=45)
    Instructions=models.TextField()
    Done_Date=models.DateField()
    Booked=(
            ('Tonny Garae','Tonny Garae'),
            ('Fredric Jacob','Fredric Jacob'),
)
Worked_By=models.CharField(max_length=45,choices=Worked)

def __unicode__(self):
        return self.Sold_deal_number


form.py

from django import forms

from foregin_exchange.models import foreginexchange

class foregin_exchange_form(forms.ModelForm):
    class Meta:
        model =foreginexchange
        widgets = {'Value_date':
forms.DateInput(attrs={'class':'datepicker'}),}
        widgets={'Done_Date':forms.DateInput(attrs={'class':'datepicker'}),}


template.html

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">


    <!-- Date Picker-->
   <meta charset="utf-8">
  <title>jQuery UI Datepicker - Default functionality</title>
  <link rel="stylesheet" href="//
code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
  <script src="//code.jquery.com/jquery-1.10.2.js"></script>
  <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
  <link rel="stylesheet" href="/resources/demos/style.css">
  <script>
  $(function() {
    $( "#datepicker" ).datepicker();
  });
  </script>

  <!--end date picker-->

  </head>

  <body>

  {%extends "loginpage.html"%}


         {%block content%}
          <h3 class="sub-header">Add New Foregin Exchange Data</h3>

          <div class="table-responsive">
            <div id="main">
                    <form action ="{% url 'test'%}"
method="post">{%csrf_token%}
                    <table>
                    {{form.as_table}}
                    </table>
                    <br>
                    <input type="submit" name="submit" value="Save Data" >
                    </form>

                    </div>
          </div>

          {%endblock%}


  </body>
</html>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPCf-y6Qh4EhFUD-opsNj-Wqp1N7SEBZD%3D4ygicC-6koYmKELQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to