C
C
Cook1eMonsta2021-07-31 13:26:45
JavaScript
Cook1eMonsta, 2021-07-31 13:26:45

Why is the form not submitting when pressing Enter?

I tried everything, the code itself in the browser works, but it lies in the old Delphi in the GameClass3 billing

Basic code in HTML
<html>

<head>
    <meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7; IE=EDGE" charset="Windows-1251" >
    <title>GameClassClient</title>
    <link rel="stylesheet" type="text/css" href="style.css">
    <script src="/script.js"></script>
</head>

<body style="margin:0 0 0 0; border:none; overflow:hidden; user-select: none" onload="startTime()">
    <div class="fon">
        <img alt="" src="gradient-steel.jpg" width="100%" height="100%" />
    </div>
    <div class="comp_number">
        %COMPNUMBER%
    </div>
        %LOGONPART%
    <div class="time">
        <p id="time"> </p>
    </div>
        %SHUTDOWNPART%
</body>

</html>

Here is half of the code in HTML
<!DOCTYPE html>
    <html>

    <head>
        <meta charset="UTF-8">
    </head>

    <body>
        <div class="login_div">
            <form action="index.html?action=logon" method="post"  >
                <table class="login_align">
                    <tr>
                        <td colspan="2" class="login_title_font">
                            <p>Пожалуйста Авторизуйтесь!</p>
                        </td>
                    </tr>
                    <tr>
                        <td class="login_warning_font">
                            <p>%WRONGNAMEORPPASSWORD%</p>
                        </td>
                    </tr>
                    <tr>
                        <td class="login_pass_font">
                            Логин
                            <input class="radius" name="login" value="" >
                        </td>
                    </tr>

                    <tr>
                        <td class="login_pass_font">
                            Пароль
                            <input type="password" class="radius" name="password" value="" >
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <!--<input type="hidden" name="enter" value="yes">-->
                            <input class="button" type="submit" value="Вход" >
                        </td>
                    </tr>
                </table>
            </form>
        </div>
    </body>

    </html>

Here is the JS

function checkTime(i)
{
    if (i<10)
    {
        i="0" + i;
    }
    return i;
}


function cssmenuhover()
{
        if(!document.getElementById("cssmenu"))
                return;
  var lis = document.getElementById("cssmenu").getElementsByTagName("LI");
        for (var i=0;i<lis.length;i++)
        {
                lis[i].onmouseover=function()
{this.className+=" iehover";}
                lis[i].onmouseout=function()
{this.className=this.className.replace(new RegExp(" iehover\\b"), "");}
        }
}
if (window.attachEvent)
        window.attachEvent("onload", cssmenuhover);

if (window.Event) 
  	document.captureEvents(Event.MOUSEUP); 

function nocontextmenu() { 
  event.cancelBubble = true, event.returnValue = false; 
   	return false; 
} 

function norightclick(e) { 
  if (window.Event) { 
    if (e.which == 2 || e.which == 3) return false; 
  } 
   	else if (event.button == 2 || event.button == 3) { 
   		event.cancelBubble = true, event.returnValue = false; 
    return false; 
  } 
} 
if (document.layers) 
  document.captureEvents(Event.MOUSEDOWN); 

document.oncontextmenu = nocontextmenu; 
document.onmousedown = norightclick; 
document.onmouseup = norightclick;

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
Hemul GM, 2021-07-31
@HemulGM

Try upgrading the IE engine version

procedure FixIE;
const
  IEVersion = 11001;
var
  Reg: TRegistry;
begin
  Reg := TRegIniFile.Create(KEY_WRITE);
  try
    Reg.RootKey := HKEY_CURRENT_USER;
    if Reg.OpenKey('SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION', True) then
    begin
      Reg.WriteInteger(ExtractFileName(ParamStr(0)), IEVersion);
      //Reg.DeleteKey(ExtractFileName(ParamStr(0))); Для удаления (если нужно)
    end;
    Reg.CloseKey;
  finally
    Reg.Free;
  end;
end;

Also, you can use CEF (Chromium engine) https://github.com/salvadordf/CEF4Delphi , but the project will be heavier by +100mb

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question