Need formsubmit function source code - Forum

Forum Navigation
You need to log in to create posts and topics.

Need formsubmit function source code

Hi

I'm trying to build a  personal plugin and need formsubmit function source code.
or can you tell me which method used in formsubmit and how return and store result to a variable?
 i use post method in javascript but i cant return and store result in a variable in visualneo.

Hi @roozbeh, I don't understand you very well.
There is a FormSubmit sample app within the MyDocuments > VisualNeoWeb > Sample Apps folder.
You will find there the source code for both VisualNEO Web and server side PHP code.

Hi Luis,
Once the form info has arrived on the server, how can we use it?

For example making sure that they are sent to an email box ...

@cdy44-2 take a look at the FormSubmit sample app (includes a php script).
You will need some kind of server side language, as php, to process the data. About sending the form content to an email box, take a look here:https://archive.visualneo.com/viewtopic.php?f=38&t=21546

It was precisely by looking closely at the "FormSubmit" program that this question came to mind.

I must admit that I am aware of the great potential of VNWeb, but I find it difficult to approach it other than as I did with VNWin (Neobook) ...
I have to change the paradigm in the way I work with VNWeb .... But I'm having trouble ...

rcohen has reacted to this post.
rcohen

@cdy44-2 It's impostant to understand how it works:

1) You fill the form fields and press the submit button.
2) The "submit" Form Object event lets you execute any script before sending the information to the server (check data fields)
3) "Return true" sends the data.
4) The data is then sent to the URL (a php script for example) you have previously set in the "action" Form Object property.
5) The data is received by the server side script (who sent it to an email, store it in a data base or use it to perform a query...)
6) The server side script writes (and send) the response.
7) On the client side, the form gets the response sent by the server side script within the [Data] variable.
8) You process the response within the "success" Form Object event.

If the php script is in a different domain you must add an special header to allow cross domain data transfer (take a look at the included .php file on the FormSubmit sample app).

VisualNEO Web offers additional options for sending and retrieving information to and from a server side script (using just commands).

Please take a look here:
https://www.keycdn.com/support/ajax-programming
https://www.w3schools.com/xml/ajax_intro.asp
https://www.w3schools.com/php/php_forms.asp

I know it seems hard at first but, believe me, once you understand how it works you will do very powerful apps.
Don't hesitate in asking whatever you need, but try to be as concise as possible please.
Regards.

 

Vadim has reacted to this post.
Vadim

Thank you for this step-by-step explanation!

I did not understand that there is no code associated with the "Submit" button,
I did not understand where the variable [data] came from, I had not seen in the properties of the form, the "action" part ", with the url of the PHP file, which was the command" return "...

Now things are becoming clearer.

In fact, what is confusing is that there is a whole bunch of little data everywhere and that you really have to look everywhere to understand how the program works.

For you it seems simple, but for a novice like me, it is sometimes confusing and frustrating not to understand well.

This is why I encourage everyone not to give up at the first difficulty. VisualNeoWeb is a nugget !!!

Don't worry, I understand you.
If you get how it works you will become a "Full Stack" programmer. :)
It takes time, but believe me, VisualNEO Web facilitates the process a lot.

Extra !!! Your example works !!! With it I can send e-mail to my mail box.

But I have an issue. With "neoapptest.php" the order of data is : FirstName, LastName, Age, Gender.    But with "senddata.php", the order of data sent to email is : FirstName, Gender, LastName, Age...

Any idea to solve that issue ?

@cdy44-2 the senddata.php file detects automatically all the data, in the same order it comes from the client.
About neoapptest.php you can edit the code and simply change the lines order.
I don't understand very well where is the problem.

See pictures below. I think (but not sure !) that the problem comes from the TAB ORDER of objects inside the "Form" object...
It seems that correct order (Fname, Lname, Age, Gender) is done in neoapptest.php file, but not in senddata.php

I may be wrong...

Uploaded files:
  • You need to login to have access to uploads.

I will try to to a form from scratch and I will tell you.

Yes, the issue came from the TAB ORDER of objects in the "Form" object; so it is not really an issue !! ;)

luishp has reacted to this post.
luishp

Buenos dias.

Podrias explicarme el procedimiento a realizar si quisiera llevar los datos de un formulario a una base de datos. Como configuro el config.php

Como quedaria el php de la accion del formulario ?

Como asocio codigo PHP en visualNeo ?

Hay algún ejemplo ?

Gracias

@carlos-alberto-montoya-cano existen varias formas de guardar datos en una base de datos. Si no conoces php lo mejor es utilizar el plugin neoPHP que lo hace mucho más sencillo. Puedes ver un tutorial paso a paso para crear una aplicación completa de bases de datos en el canal de VisualNEO en YouTube:

https://www.youtube.com/watch?v=jIAN5B2dSl0&list=PL0I-4WLYvbmg0uBSo6jabSg034o8_lbfx

Saludos!

Buenas tardes.

Ya trabaje y aplique varios ejemplos para tratar las bases de datos y con eso no hay problema. El problema y la pregunta concreta que te hice es como puedo guardar la informacion ingresada en un formulario en una base de datos. Supongo que puedo hacerlo en el php de la accion del formulario, pero cómo llamo desde PHP a la subrutina que me permite ingresar los datos ? o cómo codifico el PHP para lograrlo ?

Cada que tenemos una duda tenemos que recurrir a buscar alternativas de respuesta en el foro y alli pasamos largo tiempo en consultas. Tenemos también, creo que en general, un problema de falta de documentacion de las funcionalidades reales de VisualNeoWeb. Por ejemplo, cómo trabaja visualneo con HTML y con PHP.

Cómo trato las variables de visualneo en PHP, como invoco las subrutinas y en genaral una descripcion general de todo su entorno.

Hoy no sé que hacer, si dedicarme a estudiar php para suplir las falencias de comprension de VisualNeo o seguir luchando para terminar de entender a VisualNeoweb.

Espero recibir respuesta clara y concreta.

Sinceramente, Muy triste.

 

 

Hola, me voy a permitir contestar un poco la pregunta de @carlos-alberto-montoya-cano que desde mi punto de vista no esta muy clara.

VisualNeoWeb tiene hasta ahora una muy buena documentación llevada a cabo por @luishp y muchas de las preguntas referidas a Php se han contestado en el foro muchas veces. No es necesario saber programar PHP ni Javascript para programar en VisualNeoWeb ya que esa es la idea de un RAD (Creador rápido de App) como VisualNeoWeb.

Lo que sí hay que comprender un poco es cómo interaccionan ambos lenguajes con el NeoScript. Php en servidor y Javascript en el cliente. Siendo un programa que permite combinar 3 lenguajes y 1 de marcado (Html) creo (en mi opinión) que las posibilidades son infinitas. Por lo tanto, aprendiendo la mecánica y ciertos detalles el aprendizaje de VisualNeoWeb es muy ameno y los resultados muy satisfactorios dado que la mayoría de cosas fuera del NeoScript están ya realizadas para que no tengamos más que cambiar detalles en el código.

Por otro lado para saber guardar datos en una base de datos necesitarías saber cómo manejar dichas bases de datos.

Canal de VisualNeo con videos buenisimos!:

Acá algunas de las consultas acerca de base de datos que me han sacado muchas dudas!:

 

 

 

luishp has reacted to this post.
luishp