Let me explain what my ultimate goal is; I want to have a colour selector on my website and then people will click "This is my colour!" and then I will get the hex code in PHP to do with it what I want (save the info in a database, use it in an email... whatever!). But right now I am stuck, I have a Java colour selector which I have downloaded and implemented on to the page but I am having trouble getting the colour (and hex code) it generates out of it! OK here is my code of the page:
CODE
<head>
<title>ColorPicker</title>
<script language="JavaScript">
var color="#808080";
</script>
</head>
<body>
<form name="submit">
<table>
<tr>
<td align="center" width="400">
<applet code="colorpicker.class" width="400" height="450" MAYSCRIPT>
<param name="variable" value="color">
</applet>
</td>
</tr>
<tr>
<td align="center"><input type="Button" value="Show value in JavaScript" onClick="alert(color);"></td>
</tr>
</table>
</form>
</body>
</html>
<title>ColorPicker</title>
<script language="JavaScript">
var color="#808080";
</script>
</head>
<body>
<form name="submit">
<table>
<tr>
<td align="center" width="400">
<applet code="colorpicker.class" width="400" height="450" MAYSCRIPT>
<param name="variable" value="color">
</applet>
</td>
</tr>
<tr>
<td align="center"><input type="Button" value="Show value in JavaScript" onClick="alert(color);"></td>
</tr>
</table>
</form>
</body>
</html>
As you can see by my example if you click the button it will give you the correct hex code and you can copy and paste it from the text box, but I would just like that button for example to give me a url like....
woopie.php?hex=#000000
But with the selected colour at the end. I have tried doing the with a form but Java and PHP on the same page dont work because PHP doesnt adapt to the changes.
Here is what I tried:
CODE
<html>
<head>
<title>ColorPicker</title>
<script language="JavaScript">
var color="#555555";
</script>
</head>
<body>
<form action="submit.php" method="get" name="submit">
<table>
<tr>
<td align="center" width="400">
<applet code="colorpicker.class" width="400" height="450" MAYSCRIPT>
<param name="variable" value="color">
</applet>
<input type="hidden" name="type" value="">
</td>
</tr>
<tr>
<td align="center" colspan="2"><input type="submit" name="Submit" value="Submit"></td>
</tr>
</table>
</form>
<script language="JavaScript">
document.submit.type.value = color;
</script>
</body>
</html>
<head>
<title>ColorPicker</title>
<script language="JavaScript">
var color="#555555";
</script>
</head>
<body>
<form action="submit.php" method="get" name="submit">
<table>
<tr>
<td align="center" width="400">
<applet code="colorpicker.class" width="400" height="450" MAYSCRIPT>
<param name="variable" value="color">
</applet>
<input type="hidden" name="type" value="">
</td>
</tr>
<tr>
<td align="center" colspan="2"><input type="submit" name="Submit" value="Submit"></td>
</tr>
</table>
</form>
<script language="JavaScript">
document.submit.type.value = color;
</script>
</body>
</html>
But it jsut keeps coming up like... filename?type=%23555555 as to what I set in the <head>.
So is there a way to make a link with that Button from the first code I already have to create the url I want?