Probably a stupid HTML question

Soldato
Joined
15 Dec 2004
Posts
3,819
Code:
<html>
<head>
<title>JavaScript Navigation Panels</title>
</head>

<body>

	<div align="center">

		<form name="form2">
	
			<select name="Colour">
	
				<option selected>.:: Please Make Your Selection ::.</option>
				<option value="Red" onClick="document.form2.output2.value='Roses'">Red</option>
				<option value="Green" onClick="document.form2.output2.value='Sea'">Blue</option>
				<option value="Blue" onClick="document.form2.output2.value='Grass'">Green</option>
				<option value="Blue" onClick="document.form2.output2.value='Sun'">Yellow</option>
	  
			</select>
			
			<p>
			
				<textarea name="output2" cols="40" rows="10">
	
				</textarea>
				
			</p>
	
		</form>
		
	</div>
	
</body>

</html>

Works for me ;)
 
Associate
Joined
7 Apr 2004
Posts
542
Location
Banbury/Coventry Uni
That seems to be a bit better, but when displayed in IE, there is still nothing in the textbox, however, there does seem to be something that can be selected.. except there is nothing there, and you cant see it when it is highlighted... what a palava...
 
Associate
Joined
21 Oct 2003
Posts
228
Code:
<html>
<head>
<script type="text/javascript">
var keys = new Array();

keys[1] = 'photoshop 7 key';
keys[2] = 'Office XP key';

function get_key(programSelect)
{
	var ProgramIndex = programSelect.selectedIndex;
	var ProgramValue = programSelect.options[ProgramIndex].value;
	document.forms['form1'].elements['cdkey'].value = (ProgramValue != 0) ? keys[ProgramValue] : '';
}
</script>
</head>

<body>

<form name="form1" id="form1">
<label for="program">Program</label>
<select name="program" id="program" onchange="get_key(this);">
	<option value="0">Select program...</option>
	<option value="1">Photoshop 7</option>
	<option value="2">Office XP</option>
</select> 
<input type="submit" name="Submit" value="Fetch CD Key..." />
<input type="text" name="cdkey" />
</form>
</body>
</html>
 
Soldato
Joined
15 Dec 2004
Posts
3,819
Code:
<html>
<head>
<title>.:: Product Activation Keys ::.</title>
</head>

<style type="text/CSS">

body 

{

border-style: solid; 
border-color: #3399CC;
padding: 1.5cm;

}

p.heading

{

font-family:  Tahoma;
font-size: 18px;
font-weight: bold;

}

</style>

<body>

	<div align="center">
	
	<p class="heading">Please select the product required and hit continue:</p>

		<form name="form2" id="form2">
	
			<select name="colour" id="colour" style="font-family: Tahoma">
	
				<option selected>.:: Please Select Your Program ::.</option>
				<option value="**Office 2003 CD Key**">Office 2003</option>
				<option value="**Windows XP Pro CD Key**">Windows XP Professional</option>
				<option value="**Ranger Client CD Key**">Ranger Client</option>
				<option value="**Logicator CD Key**">Logicator</option>	  
				<option value="**PRO Desktop CD Key**">PRO Desktop</option>
				
			</select>
			
			<p>
			
			<input type="button" name="go" value="Continue..." onClick=document.form2.output2.value=document.form2.colour.options[document.form2.colour.selectedIndex].value style="font-family: Tahoma; font-weight: bold"></input>
			
			
			</p>
			<p>
			
				<textarea name="output2" cols="60" rows="10" style="font-family: Tahoma">
	
				</textarea>
				
			</p>
	
		</form>
		
	</div>
	
</body>

</html>

That's how I would do it- a much better way than arrays in my opinion :) If you copy that into notepad, save it as a .html file and it should give you something like this. I've also tested it in IE and it works fine. Hope that's OK for you :cool:
 
Associate
Joined
7 Apr 2004
Posts
542
Location
Banbury/Coventry Uni
Right... Something is afoot here. Can someone else copy Triggers html and try it. I get 'undefined' in the text box. Ive tried it in Notepad and in Dreamweaver8, and it keeps giving me the same damn message. How irritating!

Thanks for your help btw Trig, your a good bloke for coding mass HTML for me! Sorry its borking at my end!
 
Soldato
Joined
15 Dec 2004
Posts
3,819
jonnyg said:
Right... Something is afoot here. Can someone else copy Triggers html and try it. I get 'undefined' in the text box. Ive tried it in Notepad and in Dreamweaver8, and it keeps giving me the same damn message. How irritating!

Thanks for your help btw Trig, your a good bloke for coding mass HTML for me! Sorry its borking at my end!


You're welcome mate :) I've just found the problem though- it's vBulletins maximum word size limit :rolleyes: Basically, if you look at the bit which says:

Code:
.value=document.form2.colour.options

There are two spaces in between 'form' and '2'. Delete the spaces and try again, then it should be fine :)
 
Back
Top Bottom