You could create a global variable called urlExtension and override the OnChange events of both text boxes. You can then start to build up the url i.e.
var urlExtension = "";
var mainUrl = "file:///home/naveen/Desktop/imp/nav2.html?"
function OnNameChange()
{
urlExtension = "Name=" + document.getElementById('Name').value;
UpdateURL();
}
function OnPasswordChange()
{
urlExtension += "&Password=" + document.getElementById('Password').value;
UpdateURL();
}
function UpdateURL()
{
document.getElementById('MyLink').getElementsByTagName('a')[0].href = mainUrl + urlExtension;
}
I would perhaps advise wrapping your < a href> tag within a span and give it a unique ID, so you can specify which specific link you want to update...Something like:
Name <input type="text" id="Name" name="Name" onchange="OnNameChange()">
Password<input type="password" id="Password" name="Password" onchange="OnPasswordChange()">
<span id='MyLink'><a href="#">Go to URL</a></span>
However, it is not a good idea to be passing sensitive information such as a password as plain txt!