Jump to content

Automatic text field creator.


pat_codes
 Share

Recommended Posts

Automatic text field creator.OK, so im a little bit new to php and I found that the best way to learn is to ask questions.Ok, so im in need of building this feature. The idea is that a user could add another text field just by clicking a link.He would add information into the textbox, and click the submit button. After he hits the submit button it would add the information into a tinymce WYSIWYG editor.The only thing im having trouble with is how to build the feature that will add another text box..Any information on where I can learn how to do this would be awesome.Check below for some example pictures.2z5obbp.png2gwyvdc.png2dv5wsl.png330h06d.png

Link to comment
Share on other sites

If you want to do that without refreshing the page then you would use Javascript instead of PHP. You would only use PHP if you want the page to refresh when they click that link, and in that case if you wanted the information still in the form then you would still need to use Javascript to basically submit the form and have PHP display it again with more fields. So, either way you're using Javascript. http://www.google.com/search?client=opera&rls=en&q=javascript+add+form+element&sourceid=opera&ie=utf-8&oe=utf-8&channel=suggest

  • Like 1
Link to comment
Share on other sites

Guest So Called
The only thing im having trouble with is how to build the feature that will add another text box..
Have the text boxes there all the time, initial CSS display attribute "none" then use JS to unhide them as desired.
Link to comment
Share on other sites

Have the text boxes there all the time, initial CSS display attribute "none" then use JS to unhide them as desired.
It is fine for limited number of elements but for arbitrary element jsg's solution is the way or creating textarea nodes using dom and inserting them in the document dynamically
Link to comment
Share on other sites

If you want to do that without refreshing the page then you would use Javascript instead of PHP. You would only use PHP if you want the page to refresh when they click that link, and in that case if you wanted the information still in the form then you would still need to use Javascript to basically submit the form and have PHP display it again with more fields. So, either way you're using Javascript. http://www.google.co...channel=suggest
SWEET! see i was mainly looking for the right wording so i could google it. You hit it on the nail man, thanks for the help.. Edited by pat_codes
Link to comment
Share on other sites

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...