Skip to content Skip to sidebar Skip to footer

Uiwebview Passing Username And Password Into A Form

I have a UIWebView set up containing my universitys intranet page, my code will pass in my username fine (as it is a number) NSString *studentNumber = @'639909'; NSString *javaScr

Solution 1:

I think if you change this:

NSString *javaScriptPass = @"document.getElementById('password').value=%@;";

to this:

NSString *javaScriptPass = @"document.getElementById('password').value='%@';";

it should work. Notice that I added single quotes around %@.

Numbers worked because the JavaScript interpreted the password you entered as a number; however, when you put a string in there with no quotes, it's tries to run you password like it's part of the code instead of as a string. You should probably add the quotes for the student number field too, since you are really using the number as a string.

Post a Comment for "Uiwebview Passing Username And Password Into A Form"