Fizgal
-
Posts
8 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by Fizgal
-
-
Hi again.
Sorry to bother you again with the same topic, but i worked on my page and tried to add up what I have learned. But something did not work. Could you tell me what i did wrong?
<!DOCTYPE html PUBLIC "-//W3C//DT XTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml/DTD/xhtml-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr"><head><title title="contact / Liens">CONTACT</title><link rel="stylesheet" type="text/css" title="css/style" href="stl.css" /><meta http-equiv="content-type" content="text-html; charset=iso-8859-1" /><script>window.onerror = function(a, b, c, d) {alert ('javascript error:n'+a+'nURL: '+b+'nLine: '+c+' Colummn: '+d);return true;}</script><script>function validateForm() { var x = document.forms ["myForm"]["fname"].value.trim(); if (x==null || x=="") { alert("Veuillez saisir votre prénom.") return false; } var y = document.forms ["myForm"]["name"].value.trim(); if (y==null || y=="") { alert("veuillez saisir votre nom.") return false; } var z = document.forms ["myForm"] ["email"].value.trim(); if (z==null || z=="") { alert("Veuillez saisir votre adresse mail.") return false; }}</script></head><body><h1>EspriTemps</h1><div id="formulaire"><h2>Contact</h2><p>Vous pouvez me contacter en laissant un commentaire.</p><form onsubmit="return valider()" method="get" name="myForm"><fieldset><legend>Vos coordonnées</legend><p>Prénom:</br><input type="text" name="fname" size="40" maxlength="30" /></p><p>Nom:</br><input type="text" name="name" size="40" maxlength="30" /></p><p>Email:</br><input type="text" name="email" size="40" maxlength="30" /></p></fieldset><p>Votre Commentaire</p><textarea rows="20" cols="80" name="commentaires" />Commentaire ici</textarea></br><input type="submit" value="Envoyer" /><p style="line-height="2em"; margin; 2em;></p></form></body></html>
I wanted to see if it would work without putting any adress on the "action" mode. But it doesn't.
Thank you.
-
Thank you. for all these infos.
-
It worked. Thank you.
If i want to apply this on my contact form, in the site I am building, does it work? or should I do something else?
-
I know it is supposed to make appear a pop-up window saying that I have to type my name, if I want to post the fromular. But no, I don't have a servo and demo_form asp file. I'm just a beginner learning html, xhtml, css and now javaScript. I realised a website still, but i want to intrioduce a contact form and want to use this javaScript to realize this pop-up window. I uesd my e-mail adress instead, but the result was the same.
-
Hi,
I am still studying JavaScript, I am learning validation form.
Then i do this exercise: (on W3C of course)
I write on my Notepad++ (language HTML)
<!DOCTYPE html><html><head><script>function validateForm() { var x = document.forms["myForm"]["fname"].value; if (x==null || x=="") { alert("First name must be filled out"); return false; }</script></head><body><form name="myForm" action="demo_form.asp" onsubmit="return validateForm()"method="post">First name: <input type="text" name="fname"><input type="submit" value="Submit"></form></body></html>
So on the action="demo_form.asp" (which I put deliberatly on bold so you can see what i mean) when i press the button "Submit"
The browser answers :
File not foundFirefox can't find the file at (then the place where I store my files) Check the file name for capitalization or other typing errors. Check to see if the file was moved, renamed or deleted.
If I put a valid e-mail adress, it goes directly to thunderbird firefox which i use. How can I verify my exercice otherwise?
-
Thank you for the advice.
-
Hi everybody,
I am learning javascript on this website. But when I did that simple exercice in the begining, it did not work.
<!DOCTYPE html><html>
<head>
<script>function myFunction() { document.getElementById("demo").innerHTML = "Paragraph changed.";</script>
<body><script src="jvsTest.js"></script><h1>My Web Page</h1><p id="demo">A Paragraph</p><button type="button" onclick="MyFunction()">Try it</button></body></html>
When you go to the demo page, you click on the button and it changes from: 'A paragraph' to 'Paragraph changed'.
so I tried it and (I use notepad++) it didn't work. I did like above, then with javascript in the <body> section, then on a separate sheet with javascript language. Still, it didn't work.
As a matter of fact, I tried the other javascripts I wrote, did not work either. My browser is Firefox, I disabled the block pop up window and tried it on Explorer and Google Chrome, and nothing works. So what could be the problem?
Why it does not work?
Javascript form validation
in JavaScript
Posted
Thank you for your precious help.