?
Solved

ASP Button to clear text

Posted on 2016-11-24
4
Medium Priority
?
83 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

777 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