Comment envoyer la forme en utilisant JS, Knot, Mongo et Express?
Je suis programmeur débutant. Je me demande comment envoyer un formulaire composé de JQuery Sélectionnez Date et Commutateurs à l'aide du bouton. Je veux envoyer le formulaire à la base de données Mongo intitulé
. Dans mon fichier
J'appelle diverses feuilles de style et fichiers javascript, dont j'ai besoin. Ensuite, j'ai configuré le champ de saisie dans
Et le bouton sous le formulaire pour l'envoi:
[code]html
<html>
<head>
<meta content="initial-scale=1.0, user-scalable=no" name="viewport"/>
<meta charset="utf-8"/>
<title>Home</title>
<!-- Local CSS and JS -->
<script src="/javascripts/home.js"></script>
<!-- Materialize: Compiled and minified CSS -->
<link href="https://cdnjs.cloudflare.com/a ... ot%3B rel="stylesheet"/>
<!-- Materialize: Compiled and minified JavaScript -->
<script src="https://cdnjs.cloudflare.com/a ... gt%3B
</head>
<body>
<!-- Input field I want to submit -->
<form action="/submit" method="post">
<input id="test1" type="radio"/><label for="test1">Test</label>
<input id="test2" type="radio"/><label for="test2">Test 2</label>
<input id="test3" type="radio"/><label for="test3">Test 3</label>
</form>
<!-- Button I want to use to submit -->
<button class="btn waves-effect waves-light" name="action" type="submit">Sumbit</button>
</body></html>
test
. Dans mon fichier
home.html
J'appelle diverses feuilles de style et fichiers javascript, dont j'ai besoin. Ensuite, j'ai configuré le champ de saisie dans
home.html
Et le bouton sous le formulaire pour l'envoi:
[code]html
<html>
<head>
<meta content="initial-scale=1.0, user-scalable=no" name="viewport"/>
<meta charset="utf-8"/>
<title>Home</title>
<!-- Local CSS and JS -->
<script src="/javascripts/home.js"></script>
<!-- Materialize: Compiled and minified CSS -->
<link href="https://cdnjs.cloudflare.com/a ... ot%3B rel="stylesheet"/>
<!-- Materialize: Compiled and minified JavaScript -->
<script src="https://cdnjs.cloudflare.com/a ... gt%3B
</head>
<body>
<!-- Input field I want to submit -->
<form action="/submit" method="post">
<input id="test1" type="radio"/><label for="test1">Test</label>
<input id="test2" type="radio"/><label for="test2">Test 2</label>
<input id="test3" type="radio"/><label for="test3">Test 3</label>
</form>
<!-- Button I want to use to submit -->
<button class="btn waves-effect waves-light" name="action" type="submit">Sumbit</button>
</body></html>
Aucun résultat connexe trouvé
Invité:
Pour répondre aux questions, connectez-vous ou registre
2 réponses
Blanche
Confirmation de:
http://cwbuecheler.com/web/tut ... ongo/
http://cwbuecheler.com/web/tut ... godb/
Voici quelques codes pertinents du 2e manuel
Du côté du client:
Sur le serveur:
users.js
app.js
Cyrille
Confirmation de:
le code:
Je vous recommande de vous familiariser avec des manuels scolaires Node.js + MongoDB CRUD à travers l'Internet.
Mongoose est une bibliothèque qui peut vous aider à identifier des diagrammes et de travailler avec une base de données.