php
- Started
- Last post
- 11 Responses
- infect0
i think he's actually generating more text boxes dynamically... so it's a bit more complicated than using DHTML to just show/hide text boxes that are already in the page.
- _jens_0
they can here..
- arench0
Enter response: The way I've done stuff like that before is I have a hidden form element that holds a variable, such as 'textbox' = 1. Set the action of the form to submit to itself (PHP_SELF). Have an 'if' statement within the same page that checks for the existance of the 'textbox' variable- if true, add your echo statements within to print additional text boxes.
- cosmo0
would u mind telling which topic it is on.
arench, I can get 1 additional textbox to appear, but if I click add again it doesn't add anymore textboxes.
- arench0
email me your code so I can see what's going on
- cosmo0
got to work. thanks buddy. just passed an extra hidden variable which keeps up with the counter to track number of textboxes.
- arench0
awesome. glad to have helped without actually doing anything!
- cosmo0
heheheh ...
- cosmo0
yeah it can be done with php itself. It's just dynamic, no need to use dhtml.
- PixelDrama0
set yourself up a variable 'n' representing an integer, append this 'n' to your form elements name. as you submit, n=n+1 so your textbox always has a unique id. im more or less an asp guy, so im not sure that will work, but i dabble in a bit of everything... its all a matter of syntax, the concepts the same.
- arlo0
I think that's more of a dhtml question than a php one- I don't know dhtml very well but I know you can show/hide things with it.