Foros del Web » Programando para Internet » Javascript »

validar contenido de un iframe

Estas en el tema de validar contenido de un iframe en el foro de Javascript en Foros del Web. tengo el siguiente codigo Código PHP: < script language = "JavaScript" > function  CheckForm  () {     var  errorMsg  =  "" ;      //Check for a subject      if ( document . ...
  #1 (permalink)  
Antiguo 28/08/2004, 00:19
Avatar de ElAprendiz  
Fecha de Ingreso: enero-2002
Ubicación: Maipu, Chile
Mensajes: 3.706
Antigüedad: 22 años, 3 meses
Puntos: 2
validar contenido de un iframe

tengo el siguiente codigo

Código PHP:
<script language="JavaScript">
function 
CheckForm () {
    var 
errorMsg "";
    
//Check for a subject
    
if (document.frmAddMessage.subject.value==""){
        
errorMsg += "\n\tSubject \t\t- Enter a Subject for your new Topic";
    }
    
    
//Check for message
    
if (document.frmAddMessage.message.value==""){
        
errorMsg += "\n\tMessage \t\t- Enter a Message to post";
    }
    
    
//If there is aproblem with the form then display an error
    
if (errorMsg != ""){
        
msg "_______________________________________________________________\n\n";
        
msg += "The form has not been submitted because there are problem(s) with the form.\n";
        
msg += "Please correct the problem(s) and re-submit the form.\n";
        
msg += "_______________________________________________________________\n\n";
        
msg += "The following field(s) need to be corrected: -\n";
        
        
errorMsg += alert(msg errorMsg "\n\n");
        return 
false;
    }
    
    
//Reset the submition page back to it's original place
    
document.frmAddMessage.action "post_message.asp"
    
document.frmAddMessage.target "_self";

    
frmAddMessage.Submit.disabled=true;
    
    return 
true;
}
</script> 
Código HTML:
<form method="post" name="frmAddMessage" action="post_message.asp=" onSubmit="return CheckForm();" onReset="return ResetForm();">
ASUNTO<INPUT TYPE="text" NAME="subject" size="70">
<IFRAME src="editor.asp?" width="100%" height="390" frameborder="no" scrolling="no" id="message"></IFRAME>
<input type="hidden" name="message" value="">
<input type="submit" name="Submit" value="Post New Topic" OnClick="document.frmAddMessage.message.value = frames.message.document.contenido.value;" tabindex="30" />
</form> 
lo que necesito es que al enviar el formulario se verifique si ha ingresado el asunto y el contenido del tema. este codigo lo saque de otro lado pero solo me valida el campo subject. si alguien conoce la forma de saber el contenido del iframe y validarlo se lo agredecere.
__________________
Manual de ASP Avanzado ;-)
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 20:16.