Javascript Variable Can't Pass Into Textbox -
I have a script that pulls data from a form when it is submitted and that data is placed on the next page Sends.
Displays this text on that page ...
& lt; Script type = "text / javascript" & gt; FormData.display ("name") & lt; / Script & gt;
Then it prints the name the user had given earlier.
So I tried to pre-populate it in a text box ....
& lt; Input class = "text" type = "text" name = "name" value = "& lt; script type =" text / javascript "> formData.display (" name ") & lt; / script & gt; / & Gt;
Unfortunately this simply shows the code instead of the actual name.
This is an easy way for me to
& lt; Script type = "text / javascript" & gt; FormData.display ("name") & lt; / Script & gt;
And put it in a text box?
Javascript is not working like this ...
Input in html Add an ID:
& lt; Input id = "myInputBox" class = "text" type = "text" name = "name" value = "" />
Just load on this JavaScript:
var elem = document.getElementById ("myInputBox"); Elem.value = "My Value";
Check Bela:
Comments
Post a Comment