Hello,

Petit question à poser...

Je souhaite intégrer un formulaire d'inscription à ma Newsletter sur ma page facebook

Mon code source HTML d'intégration de formulaire web fonctionne.

Par contre, il semblerait qu'il faille changer quelque chose sur le code (le passer en FBML/FBJS ?)pour que le formulaire fonctionne sur facebook.J'ai deja essayé de supprimer les balises inutils comme HTML ou Head mais ça ne fonctionne toujours pas

Avez-vous une solution à ce problème ?
Ci-dessous le code source
Code Javascript :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
 
<html> 
<head> 
<title>Webform</title> 
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> 
<script language="javascript"> 
var dtCh='/'; 
var minYear=1900; 
var maxYear=2100; 
function isValidInteger(s){ 
var i; 
for(i=0;i<s.length;i++){ 
var c=s.charAt(i); 
if(((c<'0')||(c>'9'))) return false; 
} 
return true; 
} 
function stripCharsInBag(s,bag){ 
var i; 
var returnString=''; 
for(i=0;i<s.length;i++){ 
var c=s.charAt(i); 
if(bag.indexOf(c)==-1) returnString+=c; 
} 
return returnString; 
} 
function daysInFebruary(year){ 
return(((year%4==0)&&((!(year % 100 == 0))||(year%400==0)))?29:28); 
} 
function DaysArray(n){ 
for(var i=1;i<=n;i++){ 
this[i]=31; 
if(i==4||i==6||i==9||i==11){this[i]=30;} 
if(i==2){this[i]=29;} 
} 
return this; 
} 
function isDateOK(dtStr){ 
if(dtStr=='') return true; 
var daysInMonth=DaysArray(12); 
var pos1=dtStr.indexOf(dtCh); 
var pos2=dtStr.indexOf(dtCh,pos1+1); 
var strDay=dtStr.substring(0,pos1); 
var strMonth=dtStr.substring(pos1+1,pos2); 
var strYear=dtStr.substring(pos2+1); 
strYr=strYear; 
if(strDay.charAt(0)=='0'&&strDay.length>1) strDay=strDay.substring(1); 
if(strMonth.charAt(0)=='0'&&strMonth.length>1) strMonth=strMonth.substring(1); 
for(var i=1;i<=3;i++){ 
if(strYr.charAt(0)=='0'&&strYr.length>1) strYr=strYr.substring(1); 
} 
month=parseInt(strMonth); 
day=parseInt(strDay); 
year=parseInt(strYr); 
if(pos1==-1||pos2==-1){ 
alert('Le format de date devrait être : dd/mm/yyyy.'); 
return false; 
} 
if(strMonth.length<1||month<1||month>12){ 
alert('Veuillez entrer un mois valide.'); 
return false; 
} 
if(strDay.length<1||day<1||day>31||(month==2&&day>daysInFebruary(year))||day>daysInMonth[month]){ 
alert('Veuillez entrer un jour valide.'); 
return false; 
} 
if(strYear.length!=4||year==0||year<minYear||year>maxYear){ 
alert('Veuillez entrer une année � 4 chiffres comprise entre '+minYear+' et '+maxYear+'.'); 
return false; 
} 
if(dtStr.indexOf(dtCh,pos2+1)!=-1||isValidInteger(stripCharsInBag(dtStr,dtCh))==false){ 
alert('Veuillez entrer une date valide.'); 
return false; 
} 
return true; 
} 
function modifyDateFormat(dt){ 
var valuesTable=dt.value.split(dtCh); 
dt.value=valuesTable[1]+dtCh+valuesTable[0]+dtCh+valuesTable[2]; 
} 
function isEmail(emailAddress){ 
emailAddressValue=emailAddress.value.toLowerCase(); 
var countryTLDs=/^(ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|Fiddlesticks|bt|bv|bw|by|bz|ca|cat|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw)$/;
var gTLDs=/^(aero|biz|cat|com|coop|edu|gov|info|int|mil|museum|name|net|org|jobs)$/; 
var basicAddress=/^(.+)@(.+)$/; 
var specialChars='\\(\\)><@,;:\\\\\\\"\\.\\[\\]'; 
 
var validChars='\[^\\s'+specialChars+'\]'; 
var validCharset='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\'-_.'; 
var quotedUser='(\"[^\"]*\")'; 
 
var atom=validChars+'+'; 
var word='('+atom+'|'+quotedUser+')'; 
var validUser=new RegExp('^'+word+'(\.'+word+')*$'); 
var symDomain=new RegExp('^'+atom+'(\.'+atom+')*$'); 
var matchArray=emailAddressValue.match(basicAddress); 
if(emailAddress.value==''||emailAddress==null){ 
return true; 
} 
if(matchArray==null){ 
alert('L\'adresse Email semble incorrecte,\nveuillez vérifier la syntaxe.'); 
emailAddress.focus(); 
return false; 
}else{ 
var user=matchArray[1]; 
var domain=matchArray[2]; 
for(i=0;i<user.length;i++){ 
if(validCharset.indexOf(user.charAt(i))==-1){ 
alert('L\'adresse Email contient des caractères invalides,\nveuillez vérifier la partie avant l\'arobase.'); 
emailAddress.focus(); 
return false; 
} 
} 
for(i=0;i<domain.length;i++){ 
if(validCharset.indexOf(domain.charAt(i))==-1){ 
alert('L\'adresse Email contient des caractères invalides,\nveuillez vérifier la partie après l\'arobase.'); 
emailAddress.focus(); 
return false; 
} 
} 
if(user.match(validUser)==null){ 
alert('L\'adresse Email semble incorrecte,\nveuillez vérifier la partie avant l\'arobase.'); 
emailAddress.focus(); 
return false; 
} 
var atomPat=new RegExp('^'+atom+'$'); 
var domArr=domain.split('.'); 
var len=domArr.length; 
for(i=0;i<len;i++){ 
if(domArr[i].search(atomPat)==-1){ 
alert('L\'adresse Email semble incorrecte,\nveuillez vérifier la partie après l\'arobase.'); 
emailAddress.focus(); 
return false; 
} 
} 
if((domArr[domArr.length-1].length==2)&&(domArr[domArr.length-1].search(countryTLDs)==-1)){ 
alert('L\'adresse Email semble incorrecte,\nveuillez vérifier le suffixe du domaine.'); 
emailAddress.focus(); 
return false; 
} 
if((domArr[domArr.length-1].length>2)&&(domArr[domArr.length-1].search(gTLDs)==-1)){ 
alert('L\'adresse Email semble incorrecte,\nveuillez vérifier le suffixe du domaine.'); 
emailAddress.focus(); 
return false; 
} 
if((domArr[domArr.length-1].length<2)||(domArr[domArr.length-1].length>6)){ 
alert('L\'adresse Email semble incorrecte,\nveuillez vérifier le suffixe du domaine.'); 
emailAddress.focus(); 
return false; 
} 
if(len<2){ 
alert('L\'adresse Email semble incorrecte.'); 
emailAddress.focus(); 
return false; 
} 
} 
return true; 
} 
String.prototype.trim = function() { return this.replace(/^\s*(\b.*\b|)\s*$/, "$1"); } 
function mandatoryText(input,fieldName){ 
if(input.value.trim()==''||input==null){ 
alert('Veuillez saisir '+fieldName+'.'); 
input.focus(); 
return false; 
} else { 
return true; 
} 
} 
function validForm(){ 
if(!mandatoryText(document.getElementById('EMAIL_FIELD'), 'Adresse e-mail')) return; 
if(!isEmail(document.getElementById('EMAIL_FIELD'))) return; 
if(!isDateOK(document.getElementById('DATEOFBIRTH_FIELD').value)) return; 
if(document.getElementById('DATEOFBIRTH_FIELD').value!='') modifyDateFormat(document.getElementById('DATEOFBIRTH_FIELD')); 
document.getElementById('emvForm').submit(); 
if(document.getElementById('DATEOFBIRTH_FIELD').value!='') modifyDateFormat(document.getElementById('DATEOFBIRTH_FIELD')); 
} 
</script> 
</head> 
<body> 
<form name="emvForm" id="emvForm" action="http://p2tre.emv3.com/D2UTF8" method="POST" target="_top"> 
<input type="hidden" name="emv_tag" value="xxxx" /> 
<input type="hidden" name="emv_ref" value="yyyy" /> 
<table> 
<tr> 
<td> 
Adresse e-mail 
</td> 
<td> 
<input type="text" id="EMAIL_FIELD" name="EMAIL_FIELD" value="" size="30" maxlength="64"> 
</td> 
</tr> 
<tr> 
<td> 
Prénom 
</td> 
<td> 
<input type="text" id="FIRSTNAME_FIELD" name="FIRSTNAME_FIELD" value="" size="30" maxlength="64"> 
</td> 
</tr> 
<tr> 
<td> 
Nom 
</td> 
<td> 
<input type="text" id="LASTNAME_FIELD" name="LASTNAME_FIELD" value="" size="30" maxlength="64"> 
</td> 
</tr> 
<tr> 
<td> 
Date de naissance 
</td> 
<td> 
<input type="text" id="DATEOFBIRTH_FIELD" name="DATEOFBIRTH_FIELD" value="" size="30" maxlength="64"> 
</td> 
</tr> 
<tr> 
<td> 
Genre 
</td> 
<td> 
<select id="TITLE_FIELD" name="TITLE_FIELD"> 
<option selected value=""></option> 
<option value="Homme">Homme</option> 
<option value="Femme">Femme</option> 
</select> 
</td> 
</tr> 
<tr> 
<td colspan="2" align="center"> 
<input type="button" value="Soumettre le formulaire" onClick="javascript:validForm();"> 
</td> 
</tr> 
</table> 
</form> 
</body> 
</html>