Click here to Skip to main content
15,922,533 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: custom javascript validation for form Pin
Anshuman Singh22-Nov-06 0:03
Anshuman Singh22-Nov-06 0:03 
QuestionHow to dynamically add Row in the Datagrid? Pin
nabeelkhan21-Nov-06 20:11
nabeelkhan21-Nov-06 20:11 
AnswerRe: How to dynamically add Row in the Datagrid? Pin
_AK_21-Nov-06 21:11
_AK_21-Nov-06 21:11 
AnswerRe: How to dynamically add Row in the Datagrid? Pin
Anshuman Singh22-Nov-06 0:06
Anshuman Singh22-Nov-06 0:06 
QuestionUploading multiple files (.NET 1.1) Pin
matthias s.21-Nov-06 20:10
matthias s.21-Nov-06 20:10 
AnswerRe: Uploading multiple files (.NET 1.1) Pin
_AK_21-Nov-06 22:06
_AK_21-Nov-06 22:06 
QuestionMouseClick event Pin
Kissy1621-Nov-06 19:28
Kissy1621-Nov-06 19:28 
AnswerRe: MouseClick event Pin
just3ala221-Nov-06 19:58
just3ala221-Nov-06 19:58 
Hi there...

This is the javascript function



function getSum(obj)
{
var v1 = document.getElementById('txt1').value;
var v2 = document.getElementById('txt2').value;

if ( !isNaN(v1) && !isNaN(v2) && !isEmpty(v1) && !isEmpty(v2) )
{
var sum = parseInt(v1) + parseInt(v2);
obj.value = sum;
}
else
{
alert("Please fill the fields with valid numbers");
}
}

function isEmpty(txt)
{
if (txt == "")
{
return true;
}
else
{
return false;
}
}



There are three text boxes in the form txt1, txt2, and txtSum

in the page load add this code ...

<br />
txtSum.Attributes.Add("onclick", "getSum(this);")<br />


Hope this would help



Best Regards
3ala2 Smile | :)
GeneralRe: MouseClick event [modified] Pin
Kissy1621-Nov-06 20:40
Kissy1621-Nov-06 20:40 
GeneralRe: MouseClick event Pin
Kissy1621-Nov-06 23:29
Kissy1621-Nov-06 23:29 
QuestionFileOpen Dialog Box in ASP.NET Pin
R.Palanivel21-Nov-06 19:21
R.Palanivel21-Nov-06 19:21 
QuestionHow to Drag files in ASP.NET Pin
R.Palanivel21-Nov-06 19:10
R.Palanivel21-Nov-06 19:10 
QuestionCheckbox and Confirmation message in ASP.NET? Pin
Vsree21-Nov-06 19:09
Vsree21-Nov-06 19:09 
AnswerRe: Checkbox and Confirmation message in ASP.NET? Pin
_AK_21-Nov-06 19:26
_AK_21-Nov-06 19:26 
GeneralRe: Checkbox and Confirmation message in ASP.NET? Pin
Vsree21-Nov-06 21:44
Vsree21-Nov-06 21:44 
GeneralRe: Checkbox and Confirmation message in ASP.NET? Pin
Vsree21-Nov-06 21:47
Vsree21-Nov-06 21:47 
GeneralRe: Checkbox and Confirmation message in ASP.NET? Pin
_AK_21-Nov-06 21:53
_AK_21-Nov-06 21:53 
QuestionRename Folder Pin
dj.rock21-Nov-06 18:59
dj.rock21-Nov-06 18:59 
AnswerRe: Rename Folder Pin
_AK_21-Nov-06 19:11
_AK_21-Nov-06 19:11 
GeneralRe: Rename Folder Pin
dj.rock21-Nov-06 19:56
dj.rock21-Nov-06 19:56 
GeneralRe: Rename Folder Pin
_AK_21-Nov-06 20:09
_AK_21-Nov-06 20:09 
Questionasp.net Pin
gayanmadu21-Nov-06 18:28
gayanmadu21-Nov-06 18:28 
AnswerRe: asp.net Pin
_AK_21-Nov-06 19:27
_AK_21-Nov-06 19:27 
AnswerRe: asp.net Pin
just3ala221-Nov-06 20:01
just3ala221-Nov-06 20:01 
QuestionCan time be specified when using Calendar control? Pin
kbalias21-Nov-06 17:37
kbalias21-Nov-06 17:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.