I have a webpage with a textbox that displays the users name - which comes from a database that I don't have access to.
I want to display their email address in a textbox below their name.
I have a list of their names and emails in an external javascipt file.
My html fields:
HTML:
<label class="textbox-label">Employee Name</label><br />
<input type="text" id="empName" name="empName">
<br />
<label class="textbox-label">Email Address</label><br />
<input type="email" name="email" id="email">
<br />
My js list:
JavaScript:
var myobject = {
'aaa@gmail.com' : 'EMPLOYEE A',
'bbb@gmail.com' : 'EMPLOYEE B',
'ccc@gmail.com' : 'EMPLOYEE C',
'ddd@gmail.com' : 'EMPLOYEE D',
'eee@gmail.com' : 'EMPLOYEE E',
};
So if "EMPLOYEE C" lands on the webpage, I want "ccc@gmail.com" to populate the email box