Wow 500 views and not 1 reply, totally amazing!!! Looks like I've done better than you guys, I've found some javascript that I was able to modify slightly, but unfortunately I can't get to work properly. I can currently add 1 title to the form field but when I try and add a second title it replaces the first and nothing gets entered to any of the following fields, I've tried a couple of different things like focus and even tried something like a stringCount but don't really know what i'm doing cause I'm just a dumbass aussie trying to have a bit of fun. Anyway heres the new code, this is the Iframe page.
HTML Code:
<html>
<body>
<h2>Video Playlist</h2>
<ul>
<li><form name="frm2" >
<input type="text" name="resp" id="input" value=" Title 1.mp4" size="45"/>
<input type="button" onclick="parent.input(this.form.resp.value);" value="Add" />
</form> </li>
<li><form name="frm2" >
<input type="text" name="resp" id="input" value=" Title 2.mp4" size="45"/>
<input type="button" onclick="parent.input(this.form.resp.value);" value="Add" />
</form> </li>
<li><form name="frm2" >
<input type="text" name="resp" id="input" value=" Title 3.mp4" size="45"/>
<input type="button" onclick="parent.input(this.form.resp.value);" value="Add" />
</form> </li>
<li><form name="frm2" >
<input type="text" name="resp" id="input" value=" Title 4.mp4" size="45"/>
<input type="button" onclick="parent.input(this.form.resp.value);" value="Add" />
</form> </li>
<li><form name="frm2" >
<input type="text" name="resp" id="input" value=" Title 5.mp4" size="45"/>
<input type="button" onclick="parent.input(this.form.resp.value);" value="Add" />
</form> </li>
<li><form name="frm2" >
<input type="text" name="resp" id="input" value=" Title 6.mp4" size="45"/>
<input type="button" onclick="parent.input(this.form.resp.value);" value="Add" />
</form> </li>
<li><form name="frm2" >
<input type="text" name="resp" id="input" value=" Title 7.mp4" size="45"/>
<input type="button" onclick="parent.input(this.form.resp.value);" value="Add" />
</form> </li>
<li><form name="frm2" >
<input type="text" name="resp" id="input" value=" Title 8.mp4" size="45"/>
<input type="button" onclick="parent.input(this.form.resp.value);" value="Add" />
</form> </li>
<li><form name="frm2" >
<input type="text" name="resp" id="input" value=" Title 9.mp4" size="45"/>
<input type="button" onclick="parent.input(this.form.resp.value);" value="Add" />
</form> </li>
<li><form name="frm2" >
<input type="text" name="resp" id="input" value=" Title 10.mp4" size="45"/>
<input type="button" onclick="parent.input(this.form.resp.value);" value="Add" />
</form> </li>
</ul>
</body>
</html>
And this is the parent page.
HTML Code:
<html>
<body>
<div id="apDiv4"><script type="text/javascript">
var fieldCount = 1;
function addVideo() {
fieldCount++;
var newVideo = document.createElement('input');
newVideo.type ='text';
newVideo.name = 'video' + fieldCount;
newVideo.id = 'nameAnchor' + fieldCount;
document.getElementById('fs').appendChild(newVideo);
}
function input(string){
var name = string;
document.getElementById('nameAnchor').value = name;
}
</script>
<h1 align="center">
<style1><span id="h1">Add Videos</span></style1>
<br>
<form action="createplaylist.php" method="post" enctype="multipart/form-data" target="_self">
<p>
<label for="file" id="p">Please click on the Add button next <br> to the video name you wish to add.</label>
<input type="text" name="video" id="video">
<fieldset id="fs">
<legend id="p">Videos you wish to add <br> (max=250)</legend><p></p>
<button onclick="addVideo(); return false;">
More fields
</button>
<input type="text" name="video1" id="nameAnchor" max="250">
</fieldset>
<input type="submit" value="Save details">
</form></div>
</body>
</html>
Any help as always is greatly appreciated. Cheers
Bookmarks