galafura Posted February 2, 2010 Share Posted February 2, 2010 Hi again Someone have some code to allow users add new text boxes in a web site. E.g. I have a site where the user can enter a friends name using a text box, and that text box has a + sign to allow the user, by clicking on it, add more friends in a new text box and then insert into the DB ... Thanks Quote Link to comment https://forums.phpfreaks.com/topic/190646-existing-php-code/ Share on other sites More sharing options...
trq Posted February 2, 2010 Share Posted February 2, 2010 That would be better achieved using Javascript. And no, this is not a code repository. Quote Link to comment https://forums.phpfreaks.com/topic/190646-existing-php-code/#findComment-1005433 Share on other sites More sharing options...
onlyican Posted February 2, 2010 Share Posted February 2, 2010 Have you heard of google, it is an amazing tool http://tinyurl.com/yzqqgk6 Quote Link to comment https://forums.phpfreaks.com/topic/190646-existing-php-code/#findComment-1005439 Share on other sites More sharing options...
galafura Posted February 2, 2010 Author Share Posted February 2, 2010 Ok ... The problem is like this: On my web site I have several text fields where the user enters the name of several items related with personal information. He can enter e.g his address in a text box with 40 char, but if he wants enter more information for the address, he will have a button (+ sign) when he can clicks on it and another same text box will be open to him ... and he will be able to enter another address ... Thanks Quote Link to comment https://forums.phpfreaks.com/topic/190646-existing-php-code/#findComment-1005511 Share on other sites More sharing options...
gwolgamott Posted February 2, 2010 Share Posted February 2, 2010 Then that sends the data to a php file, could call the same page with the new data even... and the page would look first if that data is there or equal to something if so... then it would then display the extra plus prefilled out fields they had already filled out. Something like that? EDIT: else javascript is easier to do that. Since this process requires a reload. PHP is a server side language remember. Quote Link to comment https://forums.phpfreaks.com/topic/190646-existing-php-code/#findComment-1005518 Share on other sites More sharing options...
galafura Posted February 2, 2010 Author Share Posted February 2, 2010 Hi again ... See the picture in attach. Tks [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/190646-existing-php-code/#findComment-1005538 Share on other sites More sharing options...
jl5501 Posted February 2, 2010 Share Posted February 2, 2010 It is a relatively simple matter to create the extra fields in javascript on the client side. You will however need to create them to have their values as arrays, and then process them on the server side to store appropriately Quote Link to comment https://forums.phpfreaks.com/topic/190646-existing-php-code/#findComment-1005544 Share on other sites More sharing options...
galafura Posted February 2, 2010 Author Share Posted February 2, 2010 Can you send me an example ... if you have ... tks Quote Link to comment https://forums.phpfreaks.com/topic/190646-existing-php-code/#findComment-1005550 Share on other sites More sharing options...
gwolgamott Posted February 2, 2010 Share Posted February 2, 2010 Its a simple idea, but um not having the code here too long to just create one... And not really possible for the most part just using php... not how you want to do it anyways. Want a Javascript example... try here: http://www.dynamicdrive.com/ They have loads of excellent dynamic menus, scripts, calendars what have you and more importantly it is a code example place... that deals with more then a server side language. Quote Link to comment https://forums.phpfreaks.com/topic/190646-existing-php-code/#findComment-1005554 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.