How can I fill a text input with a value? I am trying this:
<input id="curso" maxlength="150" name="curso" size="40" type="text"
value="window.location.href.substring(91))" />
But that does not work.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can’t execute JavaScript from within an arbitrary HTML attribute. Only
<script>elements and event handlers can contain JavaScript, so add a<script>that sets the value.You also need to set the
defaultValueproperty so that any form reset resets the value to the desired value.