Fieliakitpase
New Member
I am completely brand new to Javascript. In fact, I'm just an Objective-C programmer looking to implement just a little Javascript into one of my apps. So, the problem is for whatever reason when I call my first function, nothing happens there I don't get the alert. When I call my second function I only get the alert, the button isn't actually clicked. Code:\[code\]function myFunction(username, password) { alert("Data will be entered"); document.getElementById('ctl00_plnMain_txtLogin').value = http://stackoverflow.com/questions/15584006/username; document.getElementById('ctl00_plnMain_txtPassword').value = http://stackoverflow.com/questions/15584006/password;}function click() { alert("The button was clicked"); document.getElementById("ctl00_plnMain_Submit1").click();}\[/code\]I can seem to run just a regular alert fine, but nothing else??? Is there something wrong in my function? If it helps, on the website here is the "username" box:\[code\]<input name="ctl00$plnMain$txtLogin" type="text" maxlength="50" id="ctl00_plnMain_txtLogin" tabindex="1">\[/code\]"password" box:\[code\]<input name="ctl00$plnMain$txtPassword" type="password" maxlength="255" id="ctl00_plnMain_txtPassword" tabindex="2">\[/code\]the button:\[code\]<input onclick="if (typeof(Page_ClientValidate) == 'function') Page_ClientValidate(''); " name="ctl00$plnMain$Submit1" type="submit" id="ctl00_plnMain_Submit1" tabindex="3" value="http://stackoverflow.com/questions/15584006/Log In" title="Log in">\[/code\]-- EDITAlso, I am starting the functions through my objective C code. I grab a js file, then I am able to use its functions on a webpage.