altv-issues icon indicating copy to clipboard operation
altv-issues copied to clipboard

RmlUI Forms not Submitting

Open Stuyk opened this issue 2 years ago • 0 comments

Description of the problem

When you create a form it does not actually ever submit. Even if you specify an event just like in the documentation for onsubmit.

https://mikke89.github.io/RmlUiDoc/pages/rml/forms.html

Reproduction steps

HTML

<form id="form" onsubmit="submit">
            <input id="input" type="text" />
            <input type="submit" value="submit">Submit</input>
</form>

JS/TS

const document = new alt.RmlDocument('/client/rmlui/input/index.rml');
document.show();
alt.toggleRmlControls(true);
alt.showCursor(true);

const form = document.getElementByID('form');

// ! -- Doesn't Work
form.on('submit', (e, args) => {
    console.log(e);
    console.log(args);
});

// ! -- Doesn't Work
form.on('onsubmit', (e, args) => {
    console.log(e);
    console.log(args);
});

// ! -- Doesn't Work
document.on('submit', (e, args) => {
    console.log(e);
    console.log(args);
});

// ! -- Doesn't Work
document.on('onsubmit', (e, args) => {
    console.log(e);
    console.log(args);
});

Expected behaviour

It actually triggers the event or give us an onchange for inputs.

Additional context

I tried making this work for 3 hours. I'm tired and cranky now.

Operating system

Windows 10

Version

latest

Stuyk avatar Jul 27 '22 22:07 Stuyk