kylewolfe — 2010-11-03T13:45:02-04:00 — #1
I'm creating a quick validation through ajax for new usernames. I had the whole thing working correctly but I've decided to change it from checking onkeyup to clicking an href link.
So I need a way to get the data from a <input> to href="checkUser(this.Value)" to send to my script.
tommichi — 2010-11-03T14:12:05-04:00 — #2
Maybe I'm totally missing something here, but why don't you put an event listener on the link that will fire the exact same function that your keyup event is firing. You can pass the target field as an argument of the function, so that your function can be reused without having to hard-code all the fields you need in it.
kylewolfe — 2010-11-03T16:00:39-04:00 — #3
Doh. I was just over thinking this and was looking at code too long.
tommichi — 2010-11-04T06:02:42-04:00 — #4
I read the post that you deleted. That is why I mentioned "You can pass the target field as an argument of the function" instead of using "this", but I assume you've figured that out now.
kylewolfe — 2010-11-04T09:08:24-04:00 — #5
Yes that's what I did. Overthinking it I suppose.