Geogebra with a Form HTML

samu.sandro shared this question 7 years ago
Answered

I want to create a form in HTML that has an input field (Enter Function) and when you click on the submit form button automatically in an applet Geogebra that function is drawn. To do this i researched in this link: http://www.geogebra.org/wik... but i don't understand how do this work.

I don't understand how add a Geogebra applet and how use evalCommand(instruction).

Where do i find information about this problem?


Thank you

Comments (4)

photo
1

hi


it's easier to use inputfields in a GGapplet itself and to embed this applet in a website.

Upload the file to GGTube, select embed in the options in the upperright corner of the screen en copy the html code into your website

chris

photo
1

I don't want upload the file and then there is a applet Geogebra with an input field. I want an input field (Javascript because first i do some calculations) and than i have to draw this function in a geogebra applet. But first i have to do some calculations and than the function is drawn. So, i need the passage from Javascript to Geogebra.

photo
1

Hi,


please have a look at

http://www.geogebra.org/wik...

(actually the first example on the page you linked also shows how to embed a file)


Once the applet is embedded you can use e.g. ggbApplet.evalCommand("C=(1,1)"); to evaluate a command (ggbApplet is the default name of a global variable that has all the API methods. You can change it using the "id" applet parameter, see http://www.geogebra.org/wik...

photo
1

  1. <! DOCTYPE html>
  2. <Html>
  3. <Head>
  4. <Title> Esempio foglio GeoGebra HTML 2 </ title>
  5. <Script src = "http://tube.geogebra.org/sc...; </ script>
  6. <Script>
  7. parametri var =
  8. {
  9. "Id": "ggbApplet",
  10. "Larghezza": 800,
  11. "Altezza": 600,
  12. "ggbBase64":"UEsDBBQACAgIAM1CWUMAAAAAAAAAAAAAAAAWAAAAZ2VvZ2VicmFfamF2YXNjcmlwdC5qc0srzUsuyczPU0hPT/LP88zLLNHQVKiuBQBQSwcI1je9uRkAAAAXAAAAUEsDBBQACAgIAM1CWUMAAAAAAAAAAAAAAAAMAAAAZ2VvZ2VicmEueG1svVZtb9s2EP6c/oqDPicxSVGyHMgp1gIFCmTdgHTDsG+URMtcZFEQKb8M/fE7kpIjpy/o0GFB7CN5D++5O96Rzl8fdw3sZW+UbtcRvSURyLbUlWrrdTTYzU0Wvb5/lddS17LoBWx0vxN2HXGHVNU62iSblBPGbgou0hu+yuKbjONX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OUlEw0yvgLjUQXbeNL3z3sQ6vswzSxqnx6jtThPwy7Qp4L6NIk/Y9M5osXBZY/yb6VzVjPeJCDHkxoz1mpV7JUO5wGxZgQ4Q7rN3QgrFay7uXkd+N/h4V0eS2Zl+pny97Uu17v3rf7j1gJLxzIF5OXuSl71bl6gwLfgCf5XFOVMgKfkGq+zzUghl66pwLTY11qsDUHu9W9/6mFNwpKxzCH+nYcf0ve/wNQSwcI2ajKq1gEAADoCgAAUEsBAhQAFAAICAgAzUJZQ9Y3vbkZAAAAFwAAABYAAAAAAAAAAAAAAAAAAAAAAGdlb2dlYnJhX2phdmFzY3JpcHQuanNQSwECFAAUAAgICADNQllD2ajKq1gEAADoCgAADAAAAAAAAAAAAAAAAABdAAAAZ2VvZ2VicmEueG1sUEsFBgAAAAACAAIAfgAAAO8EAAAAAA=="
  13. };
  14. var applet = new GGBApplet (parametri, '5.0');
  15. window.onload = function () {applet.inject ( 'ggbApplet')};
  16. Funzione myLittleConstruction ()
  17. {
  18. var applet = document.ggbApplet;
  19. applet.evalCommand ( "A = (1,1)");
  20. applet.evalCommand ( "B = (3,2)");
  21. applet.evalCommand ( "s = Linea [A, B]");
  22. }
  23. </ Script>
  24. </ Head>
  25. <Body>
  26. <Form>
  27. <Input type = valore "pulsante" = "Fare costruzione" onclick = "myLittleConstruction ();">
  28. </ Form>
  29. </ Body>
  30. </ Html>


I created this simple html page looking the first example on this page: http://www.geogebra.org/wik... but it doesn't work.

If i open developer tools on Chrome it finds two problems:

1. TypeError Uncaught: Impossibile leggere proprietà "childNodes 'di null

2. prova.html: 19 Uncaught ReferenceError: ggbApplet non è definito;

Dove definisco ggbApplet?

How do i do to solve this problem?

Thank you.

© 2023 International GeoGebra Institute