?
Solved

ASP Button to clear text

Posted on 2016-11-24
4
Medium Priority
?
90 Views
Last Modified: 2016-11-24
I want to clear a text field at the press of a button, I have this: -
function BlankText() {
    document.getElementById("DispatchNote").reset();
}

Open in new window


Then this: -
<td class="auto-style1"><input name="Clear" type="submit" value="Clear Input" onclick="return BlankText()"/></td>

Open in new window


This is the text box: -
<td><input name="DispatchNote" id="DispatchNote" type="text" maxlength="20" value="<%=Request.Form("DispatchNote")%>"/></td>

Open in new window


Can anyone tell me why it is not working?
0
Comment
Question by:HKFuey
  • 2
  • 2
4 Comments
 

Accepted Solution

by:
HKFuey earned 0 total points
ID: 41900370
Just needed: -
function BlankText() {
    document.getElementById("DispatchNote").value = "";
}
0
 

Author Closing Comment

by:HKFuey
ID: 41900371
Works
0
 
LVL 31

Expert Comment

by:Wayne Barron
ID: 41900375
I am not on my development computer, so I could not debug your provided code.
However, you can give the following code a shot.

<script>
function ClearFields() {

     textfield1.value = "";
}
</script>

<button type="button" onclick="ClearFields();">Clear</button>

<input type="text" value="A new value" id="textfield1">

Open in new window


HTH Carrzkiss
0
 
LVL 31

Expert Comment

by:Wayne Barron
ID: 41900376
A little late, glad someone was able to asist.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Screencast - Getting to Know the Pipeline
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses
Course of the Month16 days, 19 hours left to enroll

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question