I'm not sure how many people in here will be strong in html, but I figured I'd post this question here anyway.
So I've done a little experimenting in html - having not touched it in years, and even then I barely knew what to do with it, and now I'm trying to work out how to access a text field's data... this code should (in my mind) make a popup with a title of the first text box and some text in it from the second text box. I know the pop-up works as I tried it first by changing <a onclick="return popup(text1, text2)">Popup</a> to <a onclick="return popup('A title', 'Some text')">Popup</a>, however now I'm trying to access some user-entered data, I can't work it out :/. Oh and I don't think I need the <form></form> tags but I put them there in case it made a difference - I'm not 100% what they do. Here's my (non-working, guesswork) code:
<html>
<title>HTML Page 1</title>
<script type = "text/javascript">
<!--
function popup(title, text) {
newwindow2=window.open('','name','height=200,width=150');
var tmp = newwindow2.document;
tmp.write('<html><head><title>' + title + '</title>');
tmp.write('<link rel="stylesheet" href="js.css">');
tmp.write('</head><body><p>' + text + '</p>');
tmp.write('<p><a href="javascript:self.close()">Close</a> this popup.</p>');
tmp.write('</body></html>');
tmp.close();
}
// -->
</script>
<body>
<form>
Text field 1: <a name="text1"><input type="text" size="15" maxlength="15" /></a>
<br>
Text field 2: <a name="text2"><input type="text" size="15" maxlength="15" /></a>
<br>
<a onclick="return popup(text1, text2)">Popup</a> (Text field 1, Text field 2)
</form>
</body>
</html>