View Full Version : PLease Help with Java !!!

05-05-2009, 08:34 PM
solved thanks

Philip M
05-05-2009, 08:38 PM
Sorry, I do not have a clue what you are talking about.

Please post your complete HTML code for the form and try to explain more clearly what your problem is.

You should note that Java and Javascript are entirely different programming languages, in spite of the confusingly similar names.

05-05-2009, 09:42 PM
solved thanks

05-05-2009, 10:00 PM
missing } and one] should be }

switchaction(){if document.getElementById("skilled").style.display="block"} else {skilled.php }

try this
I have not tested, but these are simple corrections

Philip M
05-05-2009, 10:21 PM
Try (and adapt) this:-

<form name="myform" onSubmit="return OnSubmitForm();">
Skilled Worker <input type = "radio" name = "rad1" id = "rad1" value = "skilled">
Business Class <input type = "radio" name = "rad1" id = "rad1" value = "business">
Family Sponsorship <input type = "radio" name = "rad1" id = "rad1"value = "family">
Experience Class <input type = "radio" name = "rad1" id = "rad1" value = "experience"><br><br>

<input type = "submit" name = "submitButton" value = "Submit">

<script type = "text/javascript">

function OnSubmitForm() {

for (var i=0; i<document.myform.rad1.length; i++) {
if (document.myform.rad1[i].checked) {
var x = document.myform.rad1[i].value;
if (x==undefined) {
alert ("Please select a category");
return false;
var newAction = "http://website.com/" + x + ".php";
alert (newAction); // delete after testing
document.myform.action = newAction;
return true;


Overheard in Italy: "The Tower of Pisa - is it actually in Pisa?"