var json = [
	
    {username: 'anju',	password:'happy', projects:'project1,project2'},
	{username: 'swarna', password:'happy1',projects:'project3,project2'},
    {username: 'pallavi', password:'happy2',projects:'project1,project4'},
    {username: 'chintu', password:'happy3',projects:'project5,project2'}
    
    
    ]
	



var LoginDetails = React.createClass({
  getInitialState: function() {
    return {
      value: ""
    };
  },
  
  setUserName: function(evt) {
    this.setState({
      userName: evt.target.value
     
    });
  },
  setPassword: function(evt) {
    this.setState({
      password: evt.target.value
     
    });
  },
  
  reset: function() {
    this.setState({
      userName: "",
      password:""
      
    });
  },
  
  
  validate: function(){
  var valid = false; 
  

   for(var i=0;i<json.length;i++)
   {
   
 if((this.state.userName==json[i].username) &&  (this.state.password == json[i].password))
  {
  alert(" username matches ");
  valid= true;
  
  }
  
  }
  if(!valid)
  {
  alert("Invalid Username or Password");
    }
  },
  
  
  render: function() {
    return (
	
	<div>
	
      <div>
	  <span>EmployeeId:
        <input type="text" value={this.state.userName} onChange={this.setUserName} ></input></span>
        </div><br/>
		<div>
		<span>Password:
		 <input type="text" value={this.state.password} onChange={this.setPassword} ></input></span>
		  </div>
		  <div>
		  <button onClick={this.reset}>Reset</button>
        <button onClick={this.validate}>Login</button>
		
		
		
           
		

    </div></div>
	
    );
  }
  
  
  
   
});
var projects = React.createClass({
    render: function() {
        return (
            <div >
			<p>Welcome {this.state.userName}</p>
            </div>
        );
    }
});


React.render(
  <div><LoginDetails /></div>,
  document.body
);

@@ -317,19 +317,16 @@
     %5D%0A%09%0A
-%0A%0A%0A
 var Logi
@@ -988,19 +988,16 @@
 %0A  %0A  %7D%0A
-  %0A
   %7D%0A  if
@@ -1064,19 +1064,16 @@
   %7D,%0A  %0A
-  %0A
   render
@@ -1512,32 +1512,8 @@
 ton%3E
-%0A%09%09%0A%09%09%0A%09%09%0A           %0A%09%09
 %0A%0A  
@@ -1547,18 +1547,8 @@
 %0A  %0A
-  %0A  %0A   %0A
 %7D);%0A
@@ -1723,14 +1723,13 @@
   %7D%0A
+
 %7D);%0A%0A
-%0A
 Reac

Update sample.js