php - How to POST dynamic input tags in codeigniter -


I am facing a serious dilemma, and thinking how this is possible. I have a form created in the codeigniter structure, there is an input tag at the end of the form, which takes a number and adds a new form with the exact rows of the input tag, which is the value of the previous input tag. I used javascript, the code is

  $ ('# formName9'). ('Change', function () {var selected = $ (this) .val (); $ ('#subform') empty (); $ ("# subForm") enclosed ('& lt; table limit = "Style =" border: none; background: # f2f2f1; margin-bottom: 10px; border-fall: collapse; margin head: 25px; box-shadow: 9px4px 8px rgba ( 50, 50, 0.75); "Cellpacing =" 0 "cellpadding =" 0 ">  td style =" text-align: center, width: 30px; border- Width: 0px; "& gt; img SRC ="  gt; & gt; & gt; & lt; td style =" text-align: center; border-width: 0px; "& gt; icize =" & lt ;? Php echo base_url (); Property / img / table_divider.png "/ & gt; & lt; / td & gt; & lt; td style =" text-line: center: width: 200px; border width: 0 px; "> strong> gt; unit's name & lt; / strong & gt; & lt; / td & gt; & lt; td style =" text-align: center; border-width: 0px; "& gt; & lt; img src =" & lt ;? Php echo base_url () ;; & Gt; Property / img / table_divider.png "/>   Input   gt; input type = "text" name = "Namaska "+ I + 'id =" Hello "+ i +' style =" width: 137 px; "/> gt;  / Pre> 

You can see that I have used different naming conventions for all addicted tags according to the loop.

Now these values ​​are to work further for PHP [Server] Should be posted, but how do I post these dynamic values? The following is, but it just hangs down my local server and

  $ ownerName = array (); ($ I = 0; $ i & lt; = $ blockUni Ts; $ I + 1) {$ owner name [$ i] = "owner name". $ I; $ This- & gt; Input-> Post ('ownername [$ i]'); }    

When adding new input text boxes, name the field below

For example, if the user wants to add 5 fields, then the output will be something like

   & Lt; Input type = "text" name = "swear name []" /> & Lt; Input type = "text" name = "swear name []" /> & Lt; Input type = "text" name = "swear name []" /> & Lt; Input type = "text" name = "swear name []" />   

Then in PHP, you can get prices such as these fields such as

  $ ownerNames = $ _POST ['ownerName']; Foreign currency ($ owner name name $ owner name) {echo is "owner's name:". $ OwnerName; }   

As you are trying to codeigner, the code will look something like this (post variable is happening) $ owner name = $ this -> Input - & gt; Post ('ownerName'); Foreign currency ($ owner name name $ owner name) {echo is "owner's name:". $ OwnerName; }

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -