Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / pas2js / 2019-08

submit??

5 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Pedro Pablo Oviedo Vera

Hello ...iit is me again...perhaps it is a stupid question but ....

I Trying traslate from Javascript to Pas2JS this:

document.informacion1,submit()

but I not find correct submit function...

on my project1.html I have a

<form id='informacion1' .....>
<input type="button" id="enviar1" ....>
</form>

and in my project1.pas....I have written :

 FBtnEnviar1:= TJSHTMLButtonElement(document.getElementById('enviar1'));
FBtnEnviar1.onclick:= @Form2Sent;

then

function Form2Sent(aEvent: TJSMouseEvent):Boolean;
var
  MensajeError: String;
begin
  MensajeError := '';
 if not(MensajeError='') then
 begin
   Window.alert('Hola '+ MensajeError);
 end
 else
   document.informacion1.submit; <<< but not find how I can do it!!!!

Is it possible?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/pas2js/attachments/20190819/94450159/attachment.html>

Reply by email

Michael Van Canneyt
to Pedro Pablo Oviedo Vera: Hello ...iit is me again...perhaps it is a stupid question but .... I Trying traslate…
Pedro Pablo Oviedo Vera wrote 6 lines
Hello ...iit is me again...perhaps it is a stupid question but .... I Trying traslate from Javascript to Pas2JS this: document.informacion1,submit()

The reset, submit and reportValidity methods of TJSHTMLFormElement were missing. I added them in trunk.

You can now simply do

document.informacion1.submit

Michael.

Reply by email

Mattias Gaertner
to Michael Van Canneyt
Show quoted text 16 lines
On Mon, 19 Aug 2019, Pedro Pablo Oviedo Vera wrote: > Hello ...iit is me again...perhaps it is a stupid question but .... > > I Trying traslate from Javascript to Pas2JS this: > > document.informacion1,submit() > The reset, submit and reportValidity methods of TJSHTMLFormElement were missing. I added them in trunk. You can now simply do document.informacion1.submit

Do you mean something like

TJSHTMLFormElement(document.getElementById('informacion1')).submit

?

Mattias

Reply by email

Michael Van Canneyt
to Mattias Gaertner
Mattias Gaertner wrote 23 lines
On Tue, 20 Aug 2019 09:43:32 +0200 (CEST) Michael Van Canneyt wrote: > On Mon, 19 Aug 2019, Pedro Pablo Oviedo Vera wrote: > > > Hello ...iit is me again...perhaps it is a stupid question but .... > > > > I Trying traslate from Javascript to Pas2JS this: > > > > document.informacion1,submit() > > > > > The reset, submit and reportValidity methods of TJSHTMLFormElement > were missing. I added them in trunk. > > You can now simply do > > document.informacion1.submit Do you mean something like TJSHTMLFormElement(document.getElementById('informacion1')).submit

Yes.
Depends obviously on what document.informacion1 actually is, but the above should always work.

Michael.

Reply by email