javascript - Displaying Different Pictures For Different Form Results -
i have form in google sites 2 text fields. don't know how retrieve data submitted. there way display different image on web page when specific answer form submitted?
here's have now:
<form action="interactive map"> start room: <input name="startroom" type="text" value="" /> end room: <input name="endroom" type="text" value="" /> <input type="submit" value="submit" /> </form>
you should have array of images
after form submitted can use random index of array images
sample code
var arrayimglocation = ['img1.jpg','img2.jpg']; var rand = arrayimglocation[math.floor(math.random() * arrayimglocation.length)];
Comments
Post a Comment