Javascript text inject

When using js to inject text into a web page text box is there a way to inject one character at a time to build a whole word ?
I used when TextBox1.textchanged to try to inject the word letter by letter but inject seems to clear the text box and inject the whole word again with each text change not just add the additional letter to the text already in the textbox.

I use
image
Im now wondering that there may be no way around this as the inject procedure is limited to only clearing and repopulating the whole text box each time its used.
Any thoughts ?

See here:

https://www.w3schools.com/HOWTO/howto_js_typewriter.asp

and use the RunJavascript block

An example:

<!DOCTYPE html>
<html>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link href="https://www.w3schools.com/w3css/4/w3.css" rel="stylesheet">

<head>
<title>Demo Inject</title>
<style>
</style>
</head>

<body>
	<label>Enter Password</label>
	<input id="input" class="w3-input w3-border w3-round-large" type="text" style="width:50%"/><br>
	<button id="submit" class="w3-btn w3-blue w3-round-large" onclick="subAlert()">Submit</button>
	<script>
	
	function subAlert() {
    setTimeout(function() {
    alert("Password " + document.getElementById("input").value + " submitted");
    }, 2000);
    }
	</script>
</body>

</html>

typewriterInject.aia (2.7 KB)

Finally found time to try this and yes it works perfectly...
Took me a little while to get my head around it and which bits to change to make it apply to the right data and web page but all good.
I had to use a clock to give focus to the text page textbox as it does a partial search as you type but all seems good now.

Thanks for the education ! :kissing_heart:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.