senojeel Posted November 7, 2006 Share Posted November 7, 2006 I am not sure what to search for so my searches for solutions haven't been helping me much. I have a form that a user submits that is for mechanical rights to music for their recording. Right now the form submits one song per form. So if they want the rights to 5 songs, they have to submit the form 5 times. What I want is to have them be able to click a button that adds a line to add another song. So if they have 5 songs, they hit the add title button 4 times. So if anyone could point me in the right direction I waould appreciate it.Thanks!Shawn Quote Link to comment Share on other sites More sharing options...
littlejones Posted November 7, 2006 Share Posted November 7, 2006 So you want the form to physically change before the person presses the submit button? Sounds like a job for javascript which will save you having to keep going back to the server for each song. I don't totally understand what you're trying to do in terms what you are referring to as 'adds a line to add another song' but you might want to look into javascript's onChange function. Quote Link to comment Share on other sites More sharing options...
senojeel Posted November 7, 2006 Author Share Posted November 7, 2006 Yes, that is essentially what I want. Basically right now the form is set up for a user to enter their information and then a single song title they want the rights to. I want to include the ability for them to add more lines, more songs.I was thinking javascript would be what I need to use. Do you know of any examples? Quote Link to comment Share on other sites More sharing options...
Orio Posted November 7, 2006 Share Posted November 7, 2006 This has nothing to do with PHP tho...[code]** in head section, between script tagsfunction dispMoreFiles() { var upbox = "<input type='file' name='userfile'><br>"; var updiv = document.getElementById("morefiles"); var addhtml = updiv.innerHTML+upbox; updiv.innerHTML = addhtml;}** Stop **** The form, in body **<form enctype="multipart/form-data" method="POST" action="upload.php"><input type="file" name="userfile"><br><div id="morefiles"></div><br><input type="button" name="operation" id="operation" value="Add more files" onClick="javascript:dispMoreFiles();"></form>**Stop **[/code]Orio. Quote Link to comment Share on other sites More sharing options...
senojeel Posted November 7, 2006 Author Share Posted November 7, 2006 I guess it doesn't, does it. Thanks Orio. I was thinking the in terms of php when I originally wrote post...I will give this a try.Shawn Quote Link to comment 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.