I am working on my first web application and I am trying to use javascript to submit a form by clicking on text. When I click on the text nothing happens. It should just open to a simple webpage for now. I know how to process forms with html, but when I try and use javascript nothing happens. I am using unix and i have already configured my server and chmod 755 the cgi file. I not it is not a server error as I have executed cgi files on it before. I am following this tutorial: http://www.thesitewizard.com/archive/textsubmit.shtml
Here is my test html:
<html>
<head>
<title>EDVT Report Generator</title>
<style>
h1 {
text-align: center;
}
<script language="JavaScript" type="text/javascript">
function getsupport ( selectedtype )
{
document.supportform.supporttype.value = selectedtype ;
document.supportform.submit() ;
}
</script>
</style>
</head>
<body>
<h1 id = "title">Test</h1>
<form name="supportform" method="post" action="/cgi-bin/hello.py">
<input type="hidden" name="supporttype" />
<a href="javascript:getsupport('Paid')" onclick = "getsupport('Paid')">Paid Support</a> or
<a href="javascript:getsupport('Free')" onclick = "getsupport('Free')">Free Support</a>
</form>
</body>
</html>
And here is the cgi file:
#!/usr/bin/python
import cgitb, cgi
cgitb.enable()
print "Content-type:text/html
"
print '<html>'
print '<head>'
print '<title>Hello Word - First CGI Program</title>'
print '</head>'
print '<body>'
print '<h2>Hello Word! This is my first CGI program</h2>'
print '</body>'
print '</html>'
I am at a complete loss with what is wrong as I do not have much experience with javascript. Any help is appreciated!