Hi all;
I just started to learn about javascript. I write this small form like this:
This is a form to let user choose different option (from a radio groups) and then it will generate the content.
[CODE]
<html>
<head>
<title>Untitled Document</title>
<script type=”text/javascript”>
function generateCode(formName, displayIn)
{
var script_path = “http://www.fastueux.com”;
var keywords = document.forms[formName].elements[“keywords”].value;
var the_code = “”;
the_code += “<a href=”http://www.mydomain.com”><img src=”” + keywords + “”/></a>nn”;
displayCode(displayIn, the_code);
}
function displayCode(displayIn, the_code)
{
var the_element = document.getElementById(displayIn);
the_element.value = “”;
the_element.value = the_code;
}
</script>
</head>
<body>
<form name=”displayResult” onsubmit=”return false;” action=”#”>
<textarea name=”embeddingCode” cols=”61″ rows=”5″ class=”anonym_textarea” id=”embeddingCode”></textarea>
<br /><br />
<input class=”anonym_FormSubmit” type=”button” name=”markAll” id=”markAll” value=”Select All” onclick=”document.displayResult.embeddingCode.select();” />
</form>
<br />
<form name=”anonymizerForm” onsubmit=”generateCode(‘anonymizerForm’, ’embeddingCode’); return false;” action=”#”>
<p>
<label>
<input type=”radio” name=”keywords” class=”anonym_input” id=”keywordsInput” value=”demo” />
Radio</label>
<br />
<label>
<input type=”radio” name=”keywords” class=”anonym_input” id=”keywordsInput” value=”demo1″ />
Radio</label>
<br />
<br />
<br />
</p>
<input type=”submit” id=”submitButton” value=”Generate Now” class=”anonym_FormSubmit” />
</form>
</body>
</html>
But everytime i click on the generate button then it said “undefined”; if i create only one option then it is fine. But i want to have 2 or 3 options; which users only can choose one of them and the generate the content.
Can you guys please help me.
Thank you very much