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

Link to comment
Share on other sites

  • 2 weeks later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.