This is my form and below is a function. I need 3 functions, 1 to store data, 1 to save the data and 1 to show all stored data. How can I do all of these functions so they all correspond with each other.
NOTE: The user will be entering the data so it's the users choice data which would temporarily be saved. The user should be able to click on the buttons to function the function but how can I do the three functions properly.
<p>Input a Song Name, Artist, Collaborations, Duration or Album</p>
<input type="text" name = "Song_Name" id= "Song_Name" size="20"> <br>
<input type="text" name = "Artist" id= "Artist" size="20"> <br>
<input type="text" name = "Collaborations" id= "Collaborations" size="20"> <br>
<input type="text" name = "Duration" id= "Duration" size="20"> <br>
<input type="text" name = "Album" id= "Album" size="20"> <br>
<input type="button" value = "Save" onclick = "Save()"> <br>
<input type="button" value = "Search" onclick = "Store()"> <br>
<input type="button" value = "Show_All" onclick = "Show_All()"> <br>
var catalogue[];
function Save = Music.Song_Name.Artist.Collaborations.Duration.Album.Save{
var SongName = document.getElementById('Song_Name').value;
var Artist = document.getElementById('Artist').value;
var Collaborations = document.getElementById('Collaborations').value;
var Duration = document.getElementById('Duration').value;
var Album = document.getElementById('Album').value;
document.write("You have chosen "+ Song_Name + Artist + Collaborations + Duration + Album)
}
Aucun commentaire:
Enregistrer un commentaire