Jump to content

How to use getParam for a html table input text field in Zend Framework?


takeme2web

Recommended Posts

Dear Experts,

 

I am fairly new to Zend Framework and I am struggling with the following;

 

If I have a simple zend_form, that I submit then I get the form submission values using the following code in the CONTROLLER action;

 

$submittedValueForField1 = $this->_request->getParam('Field1');

 

However, if I have a HTML FORM (read as ViewScript in MVC ZF terminology) with a Table and has couple of the table field columns as input text fields such as shown below;

<td>

<a href='/order/addtocart/itemid/<?php echo $this->item_id; ?>/itemname/<?php echo $this->item_name; ?>/requestdate/2010-10-20/requestquantity/100 '>Add to Order</a>

</td>

<td> <?php echo $this->item_name; ?> </td>

<td> <input type="text" name="requestdate" id="requestdate" value="<?php echo date("Y-m-d", time()); ?>" size="12" /> </td>

<td> <input type="text" name="requestquantity" id="requestquantity" value="1" size="12" /> </td>

 

These two fields (requestquantity and requestdate) are user entered fields in the html table. Upon submission, how do I pass the user entered fields to a controller action?  In the above, I pass the variables in the "Add to Order" link which executes the "addtocartAction" in the controller.  In the above example, I have simply hard coded the request date and request quantity. The other values such as itemid, itemname are obtained as part of the DB Adapter paginator.

 

Appreciate your help?

 

Regards

Takeme2Web-Bala

  • 2 weeks later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.