pat_codes Posted July 5, 2012 Report Share Posted July 5, 2012 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. Link to comment Share on other sites More sharing options...
justsomeguy Posted July 5, 2012 Report Share Posted July 5, 2012 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 1 Link to comment Share on other sites More sharing options...
Guest So Called Posted July 5, 2012 Report Share Posted July 5, 2012 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 More sharing options...
birbal Posted July 6, 2012 Report Share Posted July 6, 2012 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 More sharing options...
pat_codes Posted July 10, 2012 Author Report Share Posted July 10, 2012 (edited) 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 July 10, 2012 by pat_codes Link to comment Share on other sites More sharing options...
perfo4911 Posted July 24, 2012 Report Share Posted July 24, 2012 you can create the text file and hide it with css .#id{visibily:hidden;}then you use javascriptdocument.forms.name.style.visiblity="visible"; anytime you want it to showand it will show instantly without refreshing the page Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now