I suspect at this point that my js code in the html doc is what's driving everything right now -- as nothing seems to relate to my external js script??? My biggest concern right now is that I still fundamentally do not understand how html and js drive AND relate to each other (I think I'm getting confused with how the variables in the external js script 'match' with the information in the html doc) -- for example, I understand what 'x' means in my external js sheet (the id), however when I tried to call the function within my html code by typing in onkeyup="copyTextInput (id);" /> or onkeyup="copyTextInput ('username_field_2') ;" /> or onkeyup="copyTextInput ('username_field_1');" /> the script just didn't work (and I'm not sure why because this made more sense to me then what I ended up doing). Also, in my external js script -- I don't get where the 'y' comes in as I'm certainly not referring to a 'y' anywhere in the html code...
here's a sample of my html code:
input id="username_field_1" class="field_box" type="text" name="username" onkeyup="document.getElementById('username_field_2').value=
document.getElementById('username_field_1').value;"
and here's a sample of my external sheet js code:
Here's the link to my webpage:
function copyTextInput(x) {
var y = document.getElementById(x).value;
document.getElementById(x).value = y.toCopyTextInput();
}
http://onepotcooking.com/annmariegatti/class4/register_now_rev.html
No comments:
Post a Comment