title: get value of form field using the input type id - in views.py django
body: <p>I have a model : as below</p>
  
  <pre><code>class Pockets(models.Model):
      pocket_owner = models.CharField(default="None",max_length=50)
      pocket_name = models.CharField(primary_key=True,max_length=50)
      pocket_description = models.CharField(max_length=500)
  
      pocket_1000 = models.IntegerField(default=0)
      pocket_500 = models.IntegerField(default=0)
      pocket_100 = models.IntegerField(default=0)
      pocket_50 = models.IntegerField(default=0)
      pocket_20 = models.IntegerField(default=0)
      pocket_10 = models.IntegerField(default=0)
      pocket_5 = models.IntegerField(default=0)
      pocket_2 = models.IntegerField(default=0)
      pocket_1 = models.IntegerField(default=0)
      pocket_change = models.FloatField(default=0)
  
      initial_amount = models.FloatField(default=0)
      sum_pocket = models.FloatField(default=0)
  
      pocket_total = models.FloatField(default=0)
  
      def save(self, *args, **kwargs):
      # self.old money wont add here , as it will duplicate records .
          self.sum_pocket = ( self.pocket_1000 * 1000 ) + (self.pocket_500 * 500) + (self.pocket_100 * 100) + \
                           (self.pocket_50 * 50) + (self.pocket_20 * 20 ) + (self.pocket_10 * 10) + \
                           (self.pocket_5 * 5) + (self.pocket_2 * 2 ) + self.pocket_1 + self.pocket_change
  
          super(Pockets, self).save(*args, **kwargs)
  
      def __unicode__(self):
          return self.pocket_name
  </code></pre>
  
  <p>and corresponding form like as below :</p>
  
  <pre><code>class PocketsTransactionForm(forms.ModelForm):
      def __init__(self, *args, **kwargs):
          super(PocketsTransactionForm, self).__init__(*args, **kwargs)
      pocket_name = forms.CharField(widget=forms.TextInput(attrs={'type':'text','class':'pocketTotalAmount'}),max_length=300,required=False)
      pocket_description = forms.CharField(widget=forms.TextInput(attrs={'type':'text','class':'pocketTotalAmount'}),max_length=500,label="Description",required=False)
      class Meta:
          model = Pockets
          exclude = ['pocket_owner']
          fields = ('pocket_name','pocket_description','pocket_1000','pocket_500','pocket_100','pocket_50','pocket_20','pocket_10','pocket_5','pocket_2','pocket_1','pocket_change')
  </code></pre>
  
  <p>now in views.py i am rendering it using 2 forms and auto_id so i can differenciate between 2 fields using ids</p>
  
  <pre><code>form1 = PocketsTransactionForm(instance=p1,auto_id='pocketTransaction_p1_%s')
  form2 = PocketsTransactionForm(instance=p2,auto_id='pocketTransaction_p2_%s')
  return render_to_response('money/addPocketTransactionsShow.html', {'form1':form1,'form2':form2,}, context)
  </code></pre>
  
  <p><strong>Problem</strong></p>
  
  <p>How to get the value of pocket_name from both fields via request.POST .. see code below :</p>
  
  <pre><code>@login_required
  def addPocketTransactionsShow(request):
      context = RequestContext(request)
      if request.method == 'POST':
          print " pocket_name from form 1 is : ",request.POST.get("pocketTransaction_p1_pocket_name")  
  # how to get value in above line ... ids for pocket name 1 and 2 are pocketTransaction_p1_pocket_name and pocketTransaction_p2_pocket_name
  </code></pre>
  
  <p>Any Advices ?</p>