JavaWing80 Posted November 7, 2021 Share Posted November 7, 2021 the following is the basic code i'm using however when i transfer it to my php file with a few edits to work with php variables the code stops working https://jsfiddle.net/a04ust13/ Not sure what the problem is any help would be appreciated Thanks Nick Quote Link to comment https://forums.phpfreaks.com/topic/314181-javascript-multiple-buttons-value-to-listbox-not-working/ Share on other sites More sharing options...
requinix Posted November 7, 2021 Share Posted November 7, 2021 It "stops working" doesn't actually mean anything. What does it do? What do you expect it to do? And post all of your code - not just some partial jsfiddle with a couple bits that don't actually match what your real code is. Quote Link to comment https://forums.phpfreaks.com/topic/314181-javascript-multiple-buttons-value-to-listbox-not-working/#findComment-1591843 Share on other sites More sharing options...
JavaWing80 Posted November 8, 2021 Author Share Posted November 8, 2021 I have a list of 728 players shown in the webpage picture that was previously posted - the value of the Button is the Players' Name so the Javascript function grabs that value when posting it to the Listbox on the right - once populated the listbox is processed to create team database entries previously it didn't post the Name Values to the Listbox however i figured it out seeing how each button needed a unique name and id and also had to create a unique Event Listener for the JavaScript to work fiddle link is as follows and i edited the code to work in my script a bit - pictures of the code is posted below.... https://jsfiddle.net/a04ust13/1/ Everything works now - by posting in here and writing down everything made me realize what was wrong Quote Link to comment https://forums.phpfreaks.com/topic/314181-javascript-multiple-buttons-value-to-listbox-not-working/#findComment-1591846 Share on other sites More sharing options...
gizmola Posted November 8, 2021 Share Posted November 8, 2021 Glad you got it figured out. For future reference, you can save yourself a lot of pain by just using the code tag feature of the forum. It's the <> button on the ribbon at the top of the editor. Just hit it and paste in your code snippet, then choose the language. Example: let age=5 for (let x=1; x < 25; x++) { age++ console.log(`Person is now ${age}.`) } 1 Quote Link to comment https://forums.phpfreaks.com/topic/314181-javascript-multiple-buttons-value-to-listbox-not-working/#findComment-1591856 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.