farhan ansari

+ Follow
since May 05, 2014
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by farhan ansari

In order to use Facelets with Trinidad i edit the web.xml file.

web.xml :

faces-config.xml :

My .xhtml file :

Below is the case when i didnot edit my web.xml : it is showing the output as :
The problem is only the text with <h:outputText value="Welcome to Symphony" styleClass="red" ></h:outputText> is rendered
but not with trinidad tags : <tr:outputText value="Welcome to Symphony" styleClass="red" > </tr:outputText>

Error 404 comes when i edit web.xml which is presently as shown above.
Is there is any thing extra i need to configure?
8 years ago
I have a basic html form :

<form method="post" action=""
onsubmit="return validate(this);">

Username: <input type="text" name="Username" size="10"><br>
Password: <input type="password" name="Password" size="10"><br>

<input type="submit" value="Submit"> <input type="reset"
value="Reset Form">

function validate(form){
var userName = form.Username.value;
var password = form.Password.value;
var errors = [];

if (checkLength(userName)) {
document.getElementByName(userName).innerHTML= 'Message';
errors.push("You must enter a username.");

if (checkLength(password)) {
errors.push("You must enter a password.");
var msg = "There were some problems...\n";
var numError;
if (errors.length > 0) {
for (var i = 0; i<errors.length; i++) {
numError = i + 1;
msg += "\n" + numError + ". " + errors[i];

//document.getElementById('fieldIdbname').innerHTML= 'Message';
return false;

return true;

function checkLength(text, min, max){
min = min || 1;
max = max || 10000;

if (text.length < min || text.length > max) {
return true;
return false;

I need to validate user inputs.
I know how to show errors through ALERT boxes.
All i need to show these below the textboxes.
i googled a lot but couldn't find one regarding the same.
I am a niebie to Javascript.