nithiz Posted June 14, 2007 Share Posted June 14, 2007 Example in the page http://www.phpfreaks.com/forums/index.php?action=post;board=16.0;poll what is the coding to make the (Add Option) function Do i have to embed javascript in the php code or i can use php code? could you show me the coding for this please...i need to add information on multiple location site for the companies.... hereby i sent an attachment, for your view....used macromedia dreamweaver [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/55543-add-multiple-data-generate-the-stored-data-in-the-same-page/ Share on other sites More sharing options...
EvanAgee Posted September 25, 2007 Share Posted September 25, 2007 If you look at the source for that page you'll see the following javascript: var pollOptionNum = 0, pollTabIndex; function addPollOption() { if (pollOptionNum == 0) { for (var i = 0; i < document.forms.postmodify.elements.length; i++) if (document.forms.postmodify.elements[i].id.substr(0, == "options-") { pollOptionNum++; pollTabIndex = document.forms.postmodify.elements[i].tabIndex; } } pollOptionNum++ setOuterHTML(document.getElementById("pollMoreOptions"), '<br /><label for="options-' + pollOptionNum + '">Option ' + pollOptionNum + '</label>: <input type="text" name="options[' + pollOptionNum + ']" id="options-' + pollOptionNum + '" value="" size="25" tabindex="' + pollTabIndex + '" /><span id="pollMoreOptions"></span>'); } Dig around in the source and you'll eventually understand it. Quote Link to comment https://forums.phpfreaks.com/topic/55543-add-multiple-data-generate-the-stored-data-in-the-same-page/#findComment-354591 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.