FORUMS


The Form Tools forums are no longer active, but the old posts have been archived here. Please see the Help page on how to get help / report issues.

Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
adding a new form
#1
hi am tryint to add a new form and having some problems and badly need some help. Down is the code of the form its not passing the line 2 when am trying. for now the form is on localhost and i need to put it on the my website on this page http://droitetvie.org/4.html.

expecting soon for a reply


<?php
require_once("http://127.0.0.1:8888/droitetvie/benevole.php");
$fields = ft_api_init_form_page("", "test");
$params = array(
"submit_button" => "submit_button_name_attribute",
"next_page" => "thanks.php",
"form_data" => $_POST,
"file_data" => $_FILES,
"finalize" => true
);
ft_api_process_form($params);
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" media="screen" type="text/css" title="Livre d'or 2" href="acceuil.css" />
<title>Droit et Vie - Formulaire Benevole</title>






<script type="text/JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
if (val) { nm=val.name; if ((val=val.value)!="") {
if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
} else if (test!='R') { num = parseFloat(val);
if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
min=test.substring(8,p); max=test.substring(p+1);
if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
} if (errors) alert('The following error(s) occurred:\n'+errors);
document.MM_returnValue = (errors == '');
}
//-->
</script>
</head>

<body>
<form action="http://benevole.droitetvie.org/process.php" method="post">
<input type="hidden" name="form_tools_initialize_form" value="1" />
<input type="hidden" name="form_tools_form_id" value="2" />
<p>Tous les champs avec une etoile sont requis</p>

<TABLE WIDTH="198" CELLPADDING="3" CELLSPACING="0" BORDER="0" STYLE="background-color: #EEEEEE; border: 1px solid #878787">
<TR>
<TD ><B> Cordonées</B></TD>
</TR>
<TR>
<TD>
<FORM NAME="info_benevol" >
<TABLE WIDTH="195" CELLPADDING="3" CELLSPACING="1" BORDER="0">
<TR>
<TD ALIGN="RIGHT">Nom*</TD>
<TD><INPUT TYPE="TEXT" NAME="nom" ...></TD>

<TD ALIGN="RIGHT">Prenom*</TD>
<TD>
<input name="prenom" type="text" /></TD>

<TD ALIGN="RIGHT">E-mail*</TD>
<TD>
<input name="mail" type="text" /></TD>
</TD>
<tr>
<td align="right">Nationalité*</td>
<td><input name="nationalite" type="text" /></td>
<td align="right">Pays*</td>
<td><input name="pays" type="text" /></td>
<td align="right">Telephonne</td>
<td><input name="tel" type="text" /></td>

</TR>
</TABLE>
</FORM>
</TD>
</TR>
</TABLE>



<br/>
<br/>

<label for="no"><b> Adress </b><br/><br/>
<label for="no">No. : </label>
<input name="no" type="text" size="5" maxlength="255" />
<label for="complement">Complement :
<input name="complement" type="text" size="30" maxlength="60" /></label>
<br/><br/>
<label for="rue">Rue : <input name="rue" type="text" size="50" maxlength="255" /></label>
<br/><br/>
<labe for="ville">Ville : <input name="ville" type="text" size="35" maxlength="255" /></label>

<label for="postal">Code postal : <input name="postal" type="text" size="5" maxlength="7" /> </label>

<br/><br/>
<label for="commentaires"> Commentaires*
<textarea name="Commentaires" cols="96" rows="30">Que pouvez vous nous dire sur vous </textarea></label>
</label>
<input name="envoyer" type="submit" value="Envoyer" />
<input name="reset" type="reset" value="Reset" />
<form name="adress" onsubmit="MM_validateForm('nom','','R','prenom','','R','mail','','RisEmail','nationalite','','R','pays','','R','tel','','NisNum','Commentaires','','R');return document.MM_returnValue">
</form>
</form>
</body>
</html>
Reply
#2
also the url 127.0.0.1 (which is my localhost) was verified
Reply
#3
Hi Khalid,

Ah! Actually, when you require() a file, you need to enter the path on the server, not the URL.

So it should look something like:

PHP Code:
require_once("/path/to/droitetvie/benevole.php"); 

instead of:

PHP Code:
require_once("http://127.0.0.1:8888/droitetvie/benevole.php"); 

Good luck!

- Ben

Reply
#4
first thanks for your help and quick response. now i am facing another problem. neither of my buttons send(envoyer) or reset are working which makes that i cannot validate the form on step 3. the form is on the website http://droitetvie.org/7.html

could you please check it for me and also verify that my php code is correct.

thanks a lot in advance for your help.




<?php
require_once("require_once("/path/to/droitetvie/7.html");
$fields = ft_api_init_form_page("", "test");
$params = array(
"submit_button" => "submit_button_name_attribute",
"next_page" => "thanks.php",
"form_data" => $_POST,
"file_data" => $_FILES,
"finalize" => true
);
ft_api_process_form($params);
?>





<!DOCTYPE html
PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html40/strict.dtd">
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="author" content="Khalid Sookia"><meta name="description" content="Droit et Vie est une association non-gouvernemental et entierement bénévole mis en place pour aider ceux dont le droit est baffoué."><meta name="keywords" content="droit, et, vie, .org, .com, association, benevole, non gouvernemental, droitetvie, droit et vie, droitetvie.com,droitetvie.org,organisme,non,lucratif,nonlucratif, non lucratif,"><title>formulaireadhesion - Droit et Vie</title><link rel="stylesheet" type="text/css" media="all" href="main.css"><link rel="stylesheet" type="text/css" media="all" href="colorschemes/colorscheme7/colorscheme.css"><link rel="stylesheet" type="text/css" media="all" href="style.css"><script type="text/javascript" src="live_tinc.js"></script></head><body id="main_body"><div id="container"><div id="header"><div id="logo"><a href="index.html"></a></div><div id="key_visual"></div><div id="slogan">La liberté c'est le respect des droits de chacun, l'ordre c'est le respect des droits de tous.</div><div id="main_nav_container"><ul id="main_nav_list"><li><a class="main_nav_item" href="index.html" id="mni2" shape="rect">Accueil</a></li><li><a class="main_nav_item" href="2.html" id="mni2" shape="rect">Forum</a></li><li><a class="main_nav_item" href="3.html" id="mni2" shape="rect">Notre Chartre</a></li><li><a class="main_nav_item" href="4.html" id="mni2" shape="rect">Devenir Benevole</a></li><li><a class="main_nav_item" href="5.html" id="mni2" shape="rect">Devenir Adhérent</a></li><li><a class="main_nav_item" href="6.html" id="mni2" shape="rect">Contact</a></li></ul></div></div><div id="main_container"><table id="layout_table"><tr><td colspan="1" id="sub_nav_column" rowspan="1"><div id="left_column_container"><div id="sub_container1"></div></div></td><td colspan="1" id="content_column" rowspan="1"><div id="sub_container2"><div class="content" id="content_container">


<p>

<script type="text/JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
if (val) { nm=val.name; if ((val=val.value)!="") {
if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
} else if (test!='R') { num = parseFloat(val);
if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
min=test.substring(8,p); max=test.substring(p+1);
if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
} if (errors) alert('The following error(s) occurred:\n'+errors);
document.MM_returnValue = (errors == '');
}
//-->
</script>
</head>

<body onsubmit="MM_validateForm('nom','','R','prenom','','R','mail','','RisEmail');return document.MM_returnValue">



<form action="http://app.droitetvie.org/process.php" method="post">
<input type="hidden" name="form_tools_initialize_form" value="1" />
<input type="hidden" name="form_tools_form_id" value="1" />
<p>Tous les champs avec une etoile (*)sont requis
</p>
<p>Compléter ce formulaire et votre demmande d'adhésion nous sera transmis. <br/>

Il est important de rentrer une adresse mail correcte afin de recevoir les informations nécessaire pour compléter voutre demmande.<br />
</p>

<TABLE WIDTH="198" CELLPADDING="3" CELLSPACING="0" BORDER="0" STYLE="background-color: #EEEEEE; border: 1px solid #878787">
<TR>
<TD ><B> Cordonées</B></TD>
</TR>
<TR>
<TD>
<FORM NAME="adhesion" >
<TABLE WIDTH="195" CELLPADDING="3" CELLSPACING="1" BORDER="0">
<TR>
<TD ALIGN="RIGHT">Nom*</TD>
<TD><INPUT TYPE="TEXT" NAME="nom" ...></TD>

<TD ALIGN="RIGHT">Prenom*</TD>
<TD>
<input name="prenom" type="text" /></TD>

<TD ALIGN="RIGHT">E-mail*</TD>
<TD>
<input name="mail" type="text" /></TD>
</TD>
<tr>
<td align="right">Nationalité</td>
<td><input name="nationalite" type="text" /></td>
<td align="right">Pays</td>
<td><input name="pays" type="text" /></td>
<td align="right">Telephonne</td>
<td><input name="tel" type="text" /></td>

</TR>
</TABLE>

</TD>
</TR></TR>
</TABLE>



<br/>
<br/>

<label for="no"><b> Adress </b><br/><br/>
<label for="no">No. : </label>
<input name="no" type="text" size="5" maxlength="255" />
<label for="complement">Complement :
<input name="complement" type="text" size="30" maxlength="60" /></label>
<br/><br/>
<label for="rue">Rue : <input name="rue" type="text" size="50" maxlength="255" /></label>
<br/><br/>
<labe for="ville">Ville : <input name="ville" type="text" size="35" maxlength="255" /></label>

<label for="postal">Code postal : <input name="postal" type="text" size="5" maxlength="7" /> </label>

<br/><br/>
<label for="commentaires"> Commentaires:<br/>
<br/>
<textarea name="Commentaires" cols="96" rows="30"></textarea></label>
</FORM>
<input name="envoyer" type="submit" value="Envoyer" />
<input name="reset" type="reset" value="Reset" />
</form>
</p>



</div>
</div></td></tr></table></div><div id="footer"><div id="footer_text"><a href="7.html">formulaireadhesion</a><span style="margin-right:25px"> </span><a href="8.html">formulaireBenevole</a><br>Réalisé par Khalid Sookia Droit et Vie © 2011-2015</div></div></div><!-- wfxbuild / 1.0 / layout6-109-1 / 2011-06-06 03:23:45 CEST--></body></html>
Reply
#5
Hi Khalid,

Change this line in the PHP:
PHP Code:
"submit_button" => "submit_button_name_attribute"

to this:
PHP Code:
"submit_button" => "envoyer"

That will fix the submit problem.

The reset should be fine though... type="reset" is just an HTML thing: it should tell the browser to empty the fields. Strange...!

- Ben
Reply
#6
Only use Relative address
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)