Jump to content

Html5 & Javascript Not Working Together


straygrey

Recommended Posts

Please tell me why the following html does not call the javascript submit_click() function.

<!DOCTYPE html>
<html>
   <head>
   <title>Page Title</title>
   <meta name="[url=""]viewport[/url]" content="[url=""]width=device-width,initial-scale=1[/url]">
   <link rel="[url=""]stylesheet[/url]" type="[url=""]text/css[/url]" href="[url="view-source:http://localhost/prince/style/style.css"]style/style.css[/url]"/>
   <script language="[url=""]Javascript[/url]" type="[url=""]text/javascript[/url]" src="[url="view-source:http://localhost/prince/js/Diva.js"]js/Diva.js[/url]"></script>
   <style type="[url=""]text/css[/url]">a {text-decoration: none}</style>
   <script language=[url=""]javascript[/url]>
   function submit_click()
       {
       alert("Button Pressed");
       progExe("logon.php?"uname="+uname+"&Passwrd="+passwrd);
       }
   </script>
   </head>

   <body>
<!--- <form name="logon" ID="logon" action="logon.php" method="post"> -->
<table align="[url=""]center[/url]" border="[url=""]3[/url]" cellspacing="[url=""]0[/url]" cellpadding="[url=""]3[/url]">
<tr><td>Username:</td><td>
<input type="[url=""]text[/url]" name="[url=""]uname[/url]" id=[url=""]uname[/url] maxlength="[url=""]40[/url]" placeholder="[url=""]Enter your UserName[/url]" autofocus required>
</td></tr>
<tr><td>Password:</td>
<td>
<input type="[url=""]password[/url]" name="[url=""]passwrd[/url]" id=[url=""]passwrd[/url] maxlength="[url=""]50[/url]" placeholder="[url=""]Password[/url]" required>
</td></tr>
<tr><td colspan="[url=""]3[/url]" align="[url=""]center[/url]">
<button type="[url=""]button[/url]" onclick="[url=""]submit_click()[/url]">Logon</button>
<a href="[url="view-source:http://localhost/prince/register.html"]register.html[/url]"><input type=[url=""]submit[/url] value="[url=""]RegisterSelf[/url]">
<a href="[url="view-source:http://localhost/prince/client.html"]client.html[/url]"><input type=[url=""]submit[/url] value="[url=""]RegisterClient[/url]">
</td></tr>
</table>
<center>
<div id="[url=""]loadingNode[/url]";></div>
</center>
</body>
</html>

Link to comment
https://forums.phpfreaks.com/topic/270064-html5-javascript-not-working-together/
Share on other sites

We were speaking of 'language', not 'type'. That said, I agree that including (or not including) either of them shouldn't make a difference. But look at his current script tag:

 

<script language=[url=""]javascript[/url]>

 

Even assuming that the is some kind of bbcode/templating code, the script tag is messed up.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.