MannyG Posted April 14, 2010 Share Posted April 14, 2010 Hey all I have a form that has a button beside one of the text fields, that has an onclick event if you click it another textfield will appear, well the script works except the textfield is created in a new page and that form wont appear anymore, it will be an empty page with just the text field...any ideas on how to fix this? o_O Link to comment https://forums.phpfreaks.com/topic/198538-javascript-and-php-problem/ Share on other sites More sharing options...
Ken2k7 Posted April 14, 2010 Share Posted April 14, 2010 I'm guessing you're using document.write(). Well don't use it. Link to comment https://forums.phpfreaks.com/topic/198538-javascript-and-php-problem/#findComment-1041806 Share on other sites More sharing options...
MatthewJ Posted April 14, 2010 Share Posted April 14, 2010 Like Ken said, you probably want to look at something like appendChild to insert your new field. Link to comment https://forums.phpfreaks.com/topic/198538-javascript-and-php-problem/#findComment-1041808 Share on other sites More sharing options...
MannyG Posted April 14, 2010 Author Share Posted April 14, 2010 yes I am using document.write();....sorry I dont know much javascript whatsoever, just need enough knowledge to make thsi work, is there any script you can show me to make it work? Link to comment https://forums.phpfreaks.com/topic/198538-javascript-and-php-problem/#findComment-1041811 Share on other sites More sharing options...
Ken2k7 Posted April 14, 2010 Share Posted April 14, 2010 As MatthewJ suggested, try appendChild. Google "JavaScript appendChild" to find out how to use it. Link to comment https://forums.phpfreaks.com/topic/198538-javascript-and-php-problem/#findComment-1041815 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.