takeme2web Posted February 16, 2010 Share Posted February 16, 2010 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 Quote Link to comment https://forums.phpfreaks.com/topic/192227-how-to-use-getparam-for-a-html-table-input-text-field-in-zend-framework/ Share on other sites More sharing options...
trq Posted February 16, 2010 Share Posted February 16, 2010 Your form needs to have <form> tags, and a defined action pointing to your controller. Quote Link to comment https://forums.phpfreaks.com/topic/192227-how-to-use-getparam-for-a-html-table-input-text-field-in-zend-framework/#findComment-1012978 Share on other sites More sharing options...
takeme2web Posted February 24, 2010 Author Share Posted February 24, 2010 Dear Mr.Thorpe, Thanks for your reply. Appreciate if you could she more light on going thru each row in the html table and getting those tiw input field values. Regards Takeme2web-Bala Quote Link to comment https://forums.phpfreaks.com/topic/192227-how-to-use-getparam-for-a-html-table-input-text-field-in-zend-framework/#findComment-1017570 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.