---
title: "How to Ennable RequiredFieldValidator With Javascript?"  
description: "How to Ennable RequiredFieldValidator With Javascript?"  
author: "Mark M"  
published: 2014-10-20  
updated: 2014-10-20  
canonical: https://www.mindstick.com/forum/2423/how-to-ennable-requiredfieldvalidator-with-javascript  
category: "javascript"  
tags: ["jquery", "validation"]  
reading_time: 1 minute  

---

# How to Ennable RequiredFieldValidator With Javascript?

[function](https://www.mindstick.com/articles/13001/multi-statement-table-valued-user-defined-function-in-sql-server) [Validation](https://www.mindstick.com/articles/12234/validation-using-data-annotation-using-entity-framework)()

{

if (document.Form1.txtfrom2.value.length > 0)

ValidatorEnable(Rftxtfrom2, [true](https://yourviews.mindstick.com/view/81326/boycott-chinese-products-dream-will-come-true));

ValidatorEnable(Rftxtjd2, true);

ValidatorEnable(Rftxtflno2, true);

ValidatorEnable(Rftxtdep2, true);

}

</[script](https://www.mindstick.com/interview/477/how-can-i-execute-a-php-script-using-command-line)>\

### i need to txtfrom2 text box contain 1 charecter 4 RequiredFieldValidator automaticaly ennable true

### thanks\

## Replies

### Reply by Anonymous User

Use below\
\
\
function Validation() \
{\
if (document.Form1.txtfrom2.value.length > 0)\
ValidatorEnable(document.getElementById(Rftxtfrom2), true);\
ValidatorEnable(document.getElementById(Rftxtjd2), true);\
ValidatorEnable(document.getElementById(Rftxtflno2), true);\
ValidatorEnable(document.getElementById(Rftxtdep2), true);\
}


---

Original Source: https://www.mindstick.com/forum/2423/how-to-ennable-requiredfieldvalidator-with-javascript

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
