Passing data from child to parent component in ReactJS

Here is parent

Passing data from child to parent component will look like

Parent

class ParentComponent extends React.Component{
    state: { language: '' }

    handleLanguage = (langValue) => {
        this.setState({language: langValue});
    }

    render() {
         return (
                <div className="col-sm-9" >
                    <SelectLanguage onSelectLanguage={this.handleLanguage}/> 
                </div>
        )
     }
}

Child

var json = require("json!../languages.json");
var jsonArray = json.languages;

export class SelectLanguage extends React.Component {
    state = {
            selectedCode: '',
            selectedLanguage: jsonArray[0],
        }

    handleLangChange = () => {
        var lang = this.dropdown.value;
        this.props.onSelectLanguage(lang);            
    }

    render() {
        return (
            <div >
                <DropdownList ref={(ref) => this.dropdown = ref}
                    data={jsonArray} 
                    valueField='lang' textField='lang'
                    caseSensitive={false} 
                    minLength={3}
                    filter='contains'
                    onChange={this.handleLangChange} />
            </div>            
        );
    }
}

https://stackoverflow.com/questions/38394015/how-to-pass-data-from-child-component-to-its-parent-in-reactjs

Select Hindi Phonetic Keyboard Layout Windows

Hindi Phonetic Typing Tool for MS Word

Select Hindi Phonetic Keyboard Layout Windows

Since I need to type in Hindi (Devnagari script) frequently and since I am not any good at typing in traditional Hindi keyboard I have to depend upon some Hindi Phonetic Typing Tool as my only long term savior and partner.

For this position, I had been using Google Hindi Phonetic Typing Tool for last few years. It is sad that Google has stopped providing this Google Input Tool anymore and has replaced it with its online tool I had to look for an alternate.

Continue reading

Adding multiple Recaptcha and custom form validation with Ajax

It is possible to add multiple Google Recaptcha on single page. Here is an example of adding Google Recaptcha in two different forms and adding custom validation to them. This example illustrates using how response ids are created when rendering of form and later using them to create custom validation on the time of submission of this form. Example uses jQuery to handle form submission events and the action of adding fields dynamically to forms where you don’t have an access to the building or rendering of the form. Continue reading

A simple way to debug a php application in production mode

How to know the location of a function defined in PHP

A simple way to debug a php application in production mode

Sometimes you want to know the location of a function defined in your php application. For example you are debugging a large online web application or website. To continue debug you want to enter into a function to debug. You don’t have an easy way to download all the files to your location system to do a text search. Also you don’t have access to file system search capabilities on the server. How to get into the function? Continue reading