Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. clear the textbox on click os submit button in update panel

clear the textbox on click os submit button in update panel

Scheduled Pinned Locked Moved ASP.NET
helpannouncement
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    rahul_miche
    wrote on last edited by
    #1

    Hi, I have a submit button in update panel and textbox which is not there in update panel. when i type something in textbox and press enter the submit should be clicked and textbox text should be cleared. I was able to get the first part.But the text is not getting cleared from textbox. Here is the snippet code: txtmsg.Attributes.Add("onkeydown", "if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {document.getElementById('" + btn1.UniqueID + "').click();return false;this.value='';}} else {return true;this.value='';} "); also i have tried to clear the textbox values by using document.getelementbyid('textboxname').value="" but it does not work.... i have tried many solutions on the net they are not working.. This is really urgent any help is really appreciated. Thnaks in adavnce

    M 1 Reply Last reply
    0
    • R rahul_miche

      Hi, I have a submit button in update panel and textbox which is not there in update panel. when i type something in textbox and press enter the submit should be clicked and textbox text should be cleared. I was able to get the first part.But the text is not getting cleared from textbox. Here is the snippet code: txtmsg.Attributes.Add("onkeydown", "if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {document.getElementById('" + btn1.UniqueID + "').click();return false;this.value='';}} else {return true;this.value='';} "); also i have tried to clear the textbox values by using document.getelementbyid('textboxname').value="" but it does not work.... i have tried many solutions on the net they are not working.. This is really urgent any help is really appreciated. Thnaks in adavnce

      M Offline
      M Offline
      Mark Graham
      wrote on last edited by
      #2

      Hi, sorry, could you just clarify.... You have a web form and it has 1) An update panel 2) A TextBox outside the UpdatePanel 3) A Button inside the UpdatePanel then you want to 1) User to type in text box 2) User to click the Button 3) Button to submit request - Panel to update 4) Textbox to clear after all this has taken place

      Mark Graham (MCP) // The Doodler blogging about C#, Asp.Net, and Design Patterns at: csCoffee[^] and contributing at dotNet Notepad[^]

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups