Holta tengo un menu que me carga paginas externas en ajax
lo he sacado de aqui
http://www.dynamicdrive.com/dynamici...axtabscontent/
lo que me passa es que en una pagina tengo un formulario que me valida los campos y cuando le doy a enviar me muestra la pagina que tiene el formulario
no se si me explica
pueden ver el error en
http://www.hoveus.info/sumer/sumer_area_empreses.asp en el apartado demandes
si no rellenan el formulario y le dan a enviar ya veran que pasa
la pagina donde esta el formulario es
con_empresa5.asp
Código PHP:
<%
'valido el formulari
Function ValidateField(sFieldvalue, sFieldtype)
ValidField = true
Select Case LCase(sFieldtype)
Case "nom_empresa"
If Len(sFieldvalue) = 0 Then ValidField = False
Case "pers_contacte"
If Len(sFieldvalue) = 0 Then ValidField = False
Case "carrec"
If Len(sFieldvalue) = 0 Then ValidField = False
Case "tel_1"
If Len(sFieldvalue) = 0 Then ValidField = False
Case "adreca"
If Len(sFieldvalue) = 0 Then ValidField = False
Case "poblacio"
If Len(sFieldvalue) = 0 Then ValidField = False
Case "provincia"
If Len(sFieldvalue) = 0 Then ValidField = False
Case "codi_post"
If Len(sFieldvalue) = 0 Then ValidField = False
Case "mail"
If Len(sFieldvalue) < 5 Then
ValidField = False
Else
If InStr(1, sFieldvalue, "@", 1) < 2 Then
ValidField = False
Else
If InStr(1, sFieldvalue, ".", 1) < 4 Then
ValidField = False
End If
End If
End If
Case "else"
ValidField = False
End Select
ValidateField = ValidField
End Function
'mostro el dormulari
Sub ShowForm%>
<form id="form1" name="form1" method="post" action="<%= Request.ServerVariables("Script_Name") %>">
<table width="392" border="0" align="center" cellpadding="0" cellspacing="5">
<tr>
<td width="92" height="20" class="text_titol_camp" >Nom Empresa*</td>
<td width="300" valign="top" class="text_titol_camp"><input name="Nom_empresa" type="text" class="camo_form" id="Nom_empresa" value="<%= Request.Form("nom_empresa") %>" size="40" />
<%If dictFields(LCase("nom_empresa")) Then %>
<%Response.Write "<font color=""red"" >*"%>
<% end if %></td>
</tr>
<tr>
<td class="text_titol_camp" >Persona de contacte *</td>
<td valign="top" class="text_titol_camp"><input name="pers_cont" type="text" class="camo_form" id="pers_cont" value="<%= Request.Form("pers_contacte") %>" size="40" />
<%If dictFields(LCase("pers_cont")) Then %>
<%Response.Write "<font color=""red"" >*"%>
<% end if %></td>
</tr>
<tr>
<td class="text_titol_camp">Càrrec</td>
<td valign="top" class="text_titol_camp"><input name="carrec" type="text" class="camo_form" id="carrec" value="<%= Request.Form("carrec") %>" size="40" />
<%If dictFields(LCase("carrec")) Then %>
<%Response.Write "<font color=""red"" >*"%>
<% end if %></td>
</tr>
<tr>
<td class="text_titol_camp">Telèfon1*</td>
<td valign="top" class="text_titol_camp"><input name="Tel_1" type="text" class="camo_form" id="Tel_1" value="<%= Request.Form("tel_1") %>" size="30" />
<%If dictFields(LCase("tel_1")) Then %>
<%Response.Write "<font color=""red"" >*"%>
<% end if %></td>
</tr>
<tr>
<td class="text_titol_camp">Telèfon2</td>
<td valign="top" class="text_titol_camp"><input name="Tel_2" type="text" class="camo_form" id="Tel_2" value="<%= Request.Form("tel_2") %>" size="30" /></td>
</tr>
<tr>
<td class="text_titol_camp" >E-mail*</td>
<td valign="top" class="text_titol_camp"><input name="Mail" type="text" class="camo_form" id="Mail" value="<%= Request.Form("mail") %>" size="40" />
<%If dictFields(LCase("mail")) Then %>
<%Response.Write "<font color=""red"" >*"%>
<% end if %></td>
</tr>
<tr>
<td class="text_titol_camp"><p>Adreça*</p> </td>
<td valign="top" class="text_titol_camp"><input name="adreca" type="text" class="camo_form" id="adreca" value="<%= Request.Form("adreca") %>" size="40" />
<%If dictFields(LCase("adreca")) Then %>
<%Response.Write "<font color=""red"" >*"%>
<% end if %></td>
</tr>
<tr>
<td class="text_titol_camp"><p >Població*</p> </td>
<td valign="top" class="text_titol_camp"><input name="Poblacio" type="text" class="camo_form" id="Poblacio" value="<%= Request.Form("poblacio") %>" size="40" />
<%If dictFields(LCase("poblacio")) Then %>
<%Response.Write "<font color=""red"" >*"%>
<% end if %></td>
</tr>
<tr>
<td class="text_titol_camp"><p >Província*</p> </td>
<td valign="top" class="text_titol_camp"><input name="Provincia" type="text" class="camo_form" id="Provincia" value="<%= Request.Form("provincia") %>" size="40" />
<%If dictFields(LCase("provincia")) Then %>
<%Response.Write "<font color=""red"" >*"%>
<% end if %></td>
</tr>
<tr>
<td class="text_titol_camp"><p>Codi Postal * </p> </td>
<td valign="top" class="text_titol_camp"><input name="codi_post" type="text" class="camo_form" id="codi_post" value="<%= Request.Form("codi_post") %>" size="20" />
<%If dictFields(LCase("codi_post")) Then %>
<%Response.Write "<font color=""red"" >*"%>
<% end if %></td>
</tr>
<tr>
<td class="text_titol_camp"> </td>
<td class="text_titol_camp"> </td>
</tr>
<tr>
<td class="text_titol_camp">Comentaris </td>
<td class="text_titol_camp"><textarea name="comentaris" cols="30" rows="5" class="camo_form" id="comentaris"><%= Request.Form("comentaris") %></textarea></td>
</tr>
<tr>
<td class="text_titol_camp"> </td>
<td class="text_titol_camp"> </td>
</tr>
<tr>
<td class="text_titol_camp" >Li podem enviar informació? </td>
<td class="text_titol_camp"><input name="publi" type="checkbox" class="camo_form" id="Publi" value="si" checked="checked" />
<span >si estic d'acord que SUMER CONSULTORA m'enviï informació </span></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td class="text_titol_camp"> </td>
<td class="text_titol_camp"><input name="Submit" type="submit" class="enviar" value=" Enviar " />
*camps obligatoris </td>
</tr>
</table>
</form>
<div align="center">
<%
End sub
Sub Send
'composo el correu
fnom_emp = Request.Form("nom_empresa")
fpers_contacte = Request.Form("pers_contacte")
fcarr = Request.Form("carrec")
ftel1 = Request.Form("Tel_1")
ftel2 = Request.Form("Tel_2")
fmail = Request.Form("Mail")
fadreca=Request.Form("adreca")
fpoblacio=Request.Form("poblacio")
fprovincia=Request.Form("provincia")
fCP=Request.Form("codi_post")
fcoment=Request.Form("comentaris")
fpubli=Request.Form("publi")
sMessage = "<b>CONTACTE GENERAL EMPRESA</B><br><br><br>"_
&"<b>Nom Empresa:</b> " & fnom_emp & "<br><br>" _
&"<b>Persona de contacte: </b>" & fpers_contacte & "<br>" _
&"<b>Càrrec: </b>" & fcarr & "<br>" _
&"<b>Tel 1: </b>" & ftel1 & "<br>" _
&"<b>Tel 2: </b>" & ftel2 & "<br>" _
&"<b>Mail: </b>" & fmail & "<br>" _
&"<b>Adreça: </b>" & fadreca & "<br><br>" _
&"<b>Poblacio: </b>" & fpoblacio & "<br>" _
&"<b>Provincia: </b>" & fprovincia & "<br>" _
&"<b>Codi Postal: </b>" & fCP & "<br>" _
&"<b>Codi Postal: </b>" & fcoment & "<br>" _
&"<b>Publi: </b>" & fpubli & "<br>"
'per enviar el correu
Set oMail = Server.CreateObject("CDO.Message")
'reemplazar aqui las variables principales
para = "[email protected]"
de = fmail
asunto = "Formulari CONTACTE GENERAL"
mensaje = sMessage
oMail.From = de
oMail.To = para
oMail.Subject= asunto
oMail.htmlBody ="<html><body class=""text_titol_camp"" bgcolor=#ffffff>" &mensaje& "</BODY></HTML>"
'DIM iMsg, Flds, iConf
'Set iMsg = CreateObject("CDO.Message")
'Set iConf = CreateObject("CDO.Configuration")
'Set Flds = iConf.Fields
'Flds(cdoSendUsingMethod) = cdoSendUsingPort
'Flds(cdoSMTPServer) = "smtp.hoveus.info"
'Flds(cdoSMTPServerPort) = 465
'Flds(cdoSMTPAuthenticate) = cdoAnonymous ' 0
'Flds(cdoSMTPAuthenticate) = cdoBasic
'Flds(cdoSendUserName) = "[email protected]"
'Flds(cdoSendPassword) = "ushuai"
'Flds.Update
'With iMsg
'Set .Configuration = iConf
'.To = "[email protected]"
'.From = fmail
'.Sender = "[email protected]"
'.Subject = "Formulari de contacte candidat curs interesat"
'.HTMLBody = "<html><body bgcolor=#ffffff>" &sMessage& "</BODY></HTML>"
'End With
'Mail.Host = "mail.esigual.com" ' Specify a valid SMTP server
'Mail.From = "[email protected]" ' direccion que envia el correo
'Mail.FromName = "[email protected]" ' Specify sender's name
'Mail.AddAddress "[email protected]"
'Mail.Subject = "Formulari Web"
'Mail.Body = "Funciona bien:" & Chr(13) & Chr(10)
'Mail.Body ="<html><body bgcolor=#ffffff>" &sMessage& "</BODY></HTML>"
'Mail.IsHTML = true
On Error Resume Next
oMail.Send
Mail.Sendtoqueue
End sub
%>
<%Set dictFields = Server.CreateObject("Scripting.Dictionary")
For Each Field in Request.Form
If ValidateField(Request.Form(Field), Field) = False Then
dictFields.Add LCase(Field), true
End If
Next
If Request.Form.Count <> 0 And dictFields.Count = 0 Then
%>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<span class="text_titol_camp"><b>Gràcies<br>
</b> Aviat ens posarem amb contacte<br />
</span>
<%
Call Send
Set oMail = Nothing
Else
ShowForm
End If
%>