473,385 Members | 1,311 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

I really some need help with this compare validator, which isn't working properly.

Hi,

I am trying to get my compare validator to fire properly...Since I have
panels the validator wouldn't work properly, the app would fire right
but would insert the data regardless and the user couldn't fix an error
if they had an error. So I added another sub and fixed the panels, but
the compare validator still doesn't work right.

Right now the validator pops up with the error that the two values
(txtAcctAmtSum and txtInvAmt) are not equal, when the correct amount is
entered, the error goes away (tabbing to next fields), but when the user
clicks the button to go to the next panel, the error displays again the
user is stuck.

The txtAcctAmtSum is an added value of all textboxes (txtAcctAmt to
txtAcctAmt14). The txtAcctAmtSum is activated by <asp:TextBox
id="txtAcctAmt8" onblur="this.onChange();" runat="server"
AutoPostBack="true" ontextchanged="doCalc"></asp:TextBox>.
I hope someone can make my day and help me fix this problem. I need to
finish this project! Thanks in advance for the assistance.

<asp:panel id="pnl4" runat="server" Height="742px" visible="false">
<asp:textbox id="txtAcctAmtSum" runat="server"></asp:textbox>
<asp:CompareValidator id="cvAcctAmt" runat="server"
ErrorMessage="Invoice Amount Out of Balance"
ControlToValidate="txtAcctAmtSum" Type="Currency"
ControlToCompare="txtInvAmt">Invoice Amount Out of Balance with Account
Amount Total.</asp:CompareValidator>
<asp:panel id="pnl3" runat="server" Height="742px" visible="false">
<asp:textbox id="txtInvAmt" runat="server" Width="188px"></asp:textbox>
'This section activated when the button is clicked, for compare
validator.
Sub checkBalance(Source as Object, E as EventArgs)
if cvAcctAmt.IsValid then
doInsert(source,e)
else
pnl1.visible="false"
pnl2.visible="false"
pnl3.visible="false"
pnl4.visible="true"
pnl5.visible="false"
end if

End Sub

'This section displays the entered information back to the user and
inserts data to the tables.
Sub doInsert(Source as Object, E as EventArgs)

pnl1.visible="false"
pnl2.visible="false"
pnl3.visible="false"
pnl4.visible="false"
pnl5.visible="true"

This could be an issue with the compare validator...the last textbox
(txtAcctAmt14) as an error on the page displayed on the toolbar when I
click in the box....Someone please help with this problem - please!

Sub doCalc(Source as Object, E as EventArgs)
'Adding account amounts and compare total to invoice amount

Dim strControlName As String
Dim i As Int16
Dim sum as Double
sum = Val(txtAcctAmt.Text)
For i = 1 To 14
strControlName = "txtAcctAmt" & i
Dim TB As TextBox = CType(Me.FindControl(strControlName),
TextBox)
If TB.Text <> "" Then
sum = sum + Val(TB.Text)
End If
Next
txtAcctAmtSum.text= sum.ToString("C")
End Sub

Please help....I really need to get through this part. Thank you!!
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #1
0 1607

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Wally Sanford | last post by:
http://wallysanford.com is currently being redirected by Namecheap to my server at home. The link to the W3C Validator has been working fine. Suddenly, that link causes the Validator to see and...
48
by: Zenobia | last post by:
Recently I was editing a document in GoLive 6. I like GoLive because it has some nice features such as: * rewrite source code * check syntax * global search & replace (through several files at...
59
by: Alan Silver | last post by:
Hello, This is NOT a troll, it's a genuine question. Please read right through to see why. I have been using Vusual Basic and Classic ASP for some years, and have now started looking at...
3
by: Sandy | last post by:
Hi All! I have a password textbox and a verify password textbox. I threw in the compare validator to make sure both values agree. I noticed, however, that immediately the compare validator...
0
by: Ewart MacLucas | last post by:
generated some WMI managed classes using the downloadable extensions for vs2003 from mircrosoft downloads; wrote some test code to enumerate the physicall processors and it works a treat, but a...
22
by: Gianni Rondinini | last post by:
hi all. please excuse the misusage of some tech terms, but writing in english is not as easy as in italian :) i'm designing our new website and, since i want to do something that will last as...
11
by: solandre | last post by:
my motivation is as follows: i have to binarysearch several million times an long that is several million items big. this costs time, although i use Array.Binarysearch<long>. so i try to keep...
0
by: RSH | last post by:
I have a situation where I am generating webcontrols dynamically from codebehind (1.1) Everything is working properly except that I am also attempting to add a Compare Validator which doesn't...
3
by: Rich Squid | last post by:
Hello Here's my basic problem: On my asp.net form page I have a DetailsView (default mode=edit) bound to a AccessDataSource control. Users can successfuly update a databound template field,...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.