PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I am trying to set up an application that will allow a user to generate a row of form elements based on a $variable that would increase in numerical value based on a form action such as submit. Also, vice a versa, I would like to remove form element rows as well. I made an attempt but so far I am only able to add row and that is it. For my approach to work I need to set a php element/$variable that I can keep adding a value to incrementally. I feel like I am almost there and just missing a key piece. Can someone gimme a clue? Maybe my whole approach is flawed, so please dont be bashful.
Thanks for the javascript alternative. It seems that as I take on more complex functionality tasks, client side scripting seems to become more an more unavoidable. I guess I need to get more familiar with it.
With regard to your second suggestion (the address_get values), I took a shot at implementing this, with no luck. So far I get it to add only one row from 3 to 4 and that's it. What piece am I missing to get the PHP solution to work? If it ends up not be practical, then I will dust off my javascript book
I'm not really sure what your trying to do. You have it now so you can assign "truset" with a default value of 3 to tell how many rows you want. If you want to remove a row just get that value and take off one, to add a new one just increase it. Put those in links, right?
I'm not quite sure what you are trying to suggest as a solution. In the part of my code where I set truset = 3, I am trying to set up a default of three rows upon landing on the page. I am trying to utilize the url and the $_GET to pull down a value, add to it and push the new value out as a url again, but it only seems to work once. It would be helpful if you provided a code example.