[Solved] Validate two text fields together in html

[ad_1]

You din’t explained your problem well, but I think this is what you want:

<input id="first" type="text">
<input id="second" type="text">
<button onClick="onClick()">Click me</button>

function onClick(){
var first = parseInt(document.getElementById("first").value);
var second = parseInt(document.getElementById("second").value);
var sum = first + second;
if (sum == 100)
{
    ...//Your code here...
}

}

Please tell me if this din’t work for you.

0

[ad_2]

solved Validate two text fields together in html