C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




textbox values should be null


Posted Date: 14 Feb 2008      Total Responses: 4

Posted By: Selvam Srinivasan       Member Level: Silver     Points: 2


Hi anybody


Pls send a javascript code for following.

After enter the values in the textbox if i click the cancel button all the texbox values should be null.
i.e., it should be empty


Thanks in Advance.




Responses

Author: bharat kumar    14 Feb 2008Member Level: GoldRating:     Points: 2
use reset button


Author: bharat kumar    14 Feb 2008Member Level: GoldRating:     Points: 2
<script type="text/javascript" language="javascript">
function ClearTextboxes()
{
document.getElementById('TextBox1').value = '';
document.getElementById('TextBox2').value = '';
}
</script>


Author: Richu Thomas    14 Feb 2008Member Level: SilverRating:     Points: 2
Either you use a reset button or else clear the values


Author: S.K.Sivakumar    14 Feb 2008Member Level: SilverRating:     Points: 2
following script function you add your java script file and call the function where you required,

using this function we abel to clear Textbox,text area , check box and option button,

function fun_ResetForm()
{

for(var x=0; x<document.Form1.length; x++)
{
if(document.Form1.elements[x].type == "checkbox")
document.Form1.elements[x].checked=false;
else if(document.Form1.elements[x].type == "text")
document.Form1.elements[x].value="";
else if(document.Form1.elements[x].type == "textarea")
document.Form1.elements[x].value="";
else if(document.Form1.elements[x].type == "radio")
document.Form1.elements[x].checked=false;
}


Post Reply
You must Sign In to post a response.
Next : Menu Scrolling
Previous : how to get checboxlist items value using javascript (Its urgent)
Return to Discussion Forum
Post New Message
Category: JavaScript

Related Messages



dotNet Slackers   BizTalk Adaptors    Web Design

accuconference

Contact Us    Privacy Policy    Terms Of Use