What is the best way to validate?

This image is a template Im using to create an expense form.
http://img160.imageshack.us/img160/963/form25vp.jpg
I have a specials item section which is just totaled from all the Special Items fields.
Was able to create a totals script to but could not get it to leave the field blank. Thanks to Justin Klei using this script it totals without a problem.
This has been placed it the Calculate section of the Total field.
var totalval = form1.costs.spei1.rawValue + form1.costs.spei2.rawValue;
if (totalval == 0 || totalval == null || totalval == "")
this.rawValue = "";
else
this.rawValue = totalval;
If the user types $12.00 into the Special Items 1 field they then are able to transfer this to the main table by clicking on any of the Special column fields. In each field Ive got the following script that will allow the user to click on any of the Special column fields and only apply the total once. If the user clicks on the Tuesday field and then decides to move the total to Sunday all they have to do is click on the Sunday field.
This have been placed in the mouse down event (will create a transparent button later).
if (this.rawValue)
sunspe.rawValue = ""
} else {
sunspe.rawValue = spetot.rawValue
monspe.rawValue = ""
tuespe.rawValue = ""
wedspe.rawValue = ""
thuspe.rawValue = ""
frispe.rawValue = ""
satspe.rawValue = ""
Ive just reused the script for each field and moved the spetot.rawValue to the appropriate day.
Here is my question.
If the user types a figure in Special Items 1 and then applies that figure to the Special column and then decides to add another figure to Special Items 2, what is the best what to validate the Special column?
Would having a message pop up be the best?
This has been placed in the Validate section of the Total field.
if (spetot.rawValue != sunc1.rawValue)
app.alert("There has been a change to the Special Item Total \n Please update the Special column.");
Is it possible for the form to automatically update the figure if it has been applied to the Special column?
The problem I have with the message currently is obviously it pops up every time you add a figure into the Special Items. Is there a way to compare only if there is a figure in the field?
Any suggestions would be appricated.

Hi,
it was the same i built my small proj with the user authentication with SQL server and JSP.
u should first create a table with 2 fields "user" and "pass"
in ur jsp the name of the textboxes for the user and pass should b the same .
use some other name to retrive the data form the table say "user1"and "pass1".
u need 2 write some connections say "
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("user", "Pass");
i'll post u the entire code soon.
thankx.

Similar Messages

  • What is the best way to double buffer in this case and how to do it....

    currently I have
    public class Frame1 extends JFrame{
    //inside this class I call up circle class, rectangle class, etc.... to draw
    }I am making a "paint" program, and I have individual classes to handle the paint methods heres an example:
    abstract public class Shape {
        public Shape() {
        public abstract void draw(Graphics g, Color c, int x, int y, int width,int height);
    }and then....
    public class Circle extends Shape{
        public Circle() {
        public void draw(Graphics g, Color c, int oldx, int oldy, int newx, int newy) {
            g.setColor(c);
            g.drawOval(Math.min(oldx, newx), Math.min(oldy, newy), Math.abs(oldx - newx), Math.abs(oldy - newy));
    }There is also a Rectangle class, line class.... etc! So my question to you is the following... what is the best way to implement double buffer in the individual classes? And how to do it?? And also.... the drawings should be kept inside a jPanel.
    Any bit of help is much appreciated Thank you!!

    You don't need to do double-buffering. Swing
    components are double-buffered by default. Just make
    sure you override paintComponent() and not paint().
    And even if you had to, why would there be any
    difference in implementation for your classes whether
    they paint to on- or off-screen graphics?I need to override paintComponent()? what if I don't...
    I am using JBuilder2005 and they automate somethings for me. So thats how they did it when they created the application they did this....
    public class Frame1 extends JFrame{
    /*** all my code here***/
    public class Application1 {
        boolean packFrame = false;
         * Construct and show the application.
        public Application1() {
            Frame1 frame = new Frame1();
            // Validate frames that have preset sizes
            // Pack frames that have useful preferred size info, e.g. from their layout
            if (packFrame) {
                frame.pack();
            } else {
                frame.validate();
            // Center the window
            Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
            Dimension frameSize = frame.getSize();
            if (frameSize.height > screenSize.height) {
                frameSize.height = screenSize.height;
            if (frameSize.width > screenSize.width) {
                frameSize.width = screenSize.width;
            frame.setLocation((screenSize.width - frameSize.width) / 2,
                              (screenSize.height - frameSize.height) / 2);
            frame.setVisible(true);
            try {
                jbInit();
            } catch (Exception ex) {
                ex.printStackTrace();
         * Application entry point.
         * @param args String[]
        public static void main(String[] args) {
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    try {
                        UIManager.setLookAndFeel(UIManager.
                                                 getSystemLookAndFeelClassName());
                    } catch (Exception exception) {
                        exception.printStackTrace();
                    new Application1();
        private void jbInit() throws Exception {
    }

  • What is the best time to validate this?

    I'm creating a standard form which asks the user for personal data (name, age, address, and so on...).
    At the end of this form the user must enter a User Name for his/her account.
    Since validating the user name requires the server to connect to the database and check wheter that name already exists or not, I'd like to do this verification only when all the other fields in the form are valid. This will reduce accesses to the DB.
    Think about connecting to the DB even when the user fails entering a valid age or other data. It seems pretty inefficient.
    What is the best way to achieve this check?
    I was thinking to create a backing bean which includes all the fields in the form, and which validates the user name field only if every single other field is valid... but I guess that's not how it should be done.
    Any idea? Please help.
    Thank you!

    That's what I do...
    The problem is: I want the other fields to be validated by their validators (and that what happens). But I want the user name to be validated only if all the other fields are valid (i.e. previously validated and accepted), otherwise no validation occours on the user name fields (except for the "needed" one)
    Is that possible?
    I'm doing it with a big Backing Bean which embodies the whole form and checks whether the other fileds are valid or not before validating the User Name.

  • What is the best way of integrating rules to a J2EE (EJB 3) application ?

    We are working in a J2EE(EJB3) project which we plan to validate business logic using rule engine(JBoss rule). What is the best way of integrating the rule engine to the application ?
    Does rule engine good for validating a large no of data volume ? (asserted as an objects)

    I don't see a big switch construct. How about trying the following:
    Call this method from your original method by passing the resultset obtained.
    public String[] convert(ResultSet rs) {
         int col = ((ResultSetMetaData) rs.getMetaData()).getColumnCount();
         String[] record = new String[col];
         int i=0;
         while(rs.next()) {
              if(rs.wasNull()) record[i] = new String();
              else record[i] = rs.getString(i);
              i++;
         return record;
    iDriZ

  • What is the best way to set up iTunes on our home network so all family members have access to all of our itunes library, even music we don't have on the cloud?

    I have five different people using 10 different apple devices on one itunes account in our family.  We have had trouble sharing.  What is the best way to set up itunes on our home network?  We have purchased music that sits on icloud, but we also have music we have imported from our previous cd library.  Our itunes program keeps crashing and dumping everyone's playlists.  So far we have all been using just the one desktop computer to sync to because we can't figure out how to share the same librarly and playlists on multiple computers in our home so devices can be synced at any location as well as playlists and purchases be made. 

    What is the best way to set up itunes on our home network? 
    One iTunes library per person.  One iTunes account per person.
    If people wish to share songs, they can make copies.
    When the inevitable day comes when the kids get older, you will not have to come back here and post asking how all that stuff can get separated!

  • HT1349 I lost/had my iPhone stolen. Tried using Find My iPhone and it's offline. It was set up. What do I do now? Do I report it stolen? What is the best way in getting back my iPhone if any? Thank you in advance.

    Tried using Find My iPhone and it's offline. It (Find my iPhone) was set up. What do I do now? Do I report it stolen? What is the best way in getting back my iPhone if any? Thank you in advance.

    Find My iPhone is good for misplaced iPhone but not good for thief and it was never meant to be.
    You chance of getting it back is very small.
    There are a few things you can try.
    Try remote lock/wipe your iPhone through Find My iPhone.
    https://www.icloud.com
    You can report to the police, cell carrier (expensive cell charges for international calls, roaming etc)
    Change all the passwords used in iPhone: Apple ID, E-mail, Bank Account ....
    http://support.apple.com/kb/HT2526

  • What is the best way to read and manipulate large data in excel files and show them in Sharepoint

    Hi ,
    I have a large excel file that has 700,000 records in it. The excel file has a few columns that change every day.
    What is the best way to read the data form the excel file in fastest and most efficient way.
    2 nd Problem,
    I have one excel file that has many rows each row contain some data that has certain keywords.
    What I want is  to segregate the data of rows into respective sheets(tabs ) in the workbook.
    for example in rows have following data 
    1. Alfa
    2beta
    3 gama
    4beta
    5gama
    6gama
    7alfa
    in excel
    I want there to be 3 tabs now with each of the key words alfa beta and gamma.

    Hi,
    I don't really see any better options for SharePoint. SharePoint use other production called 'Office Web App' to allow users to view/edit Microsoft Office documents (word, excel etc.). But the web version of excel doesn't support that much records as well
    as there's size limitations (probably the default max size is 10MB).
    Regarding second problem, I think you need some custom solutions (like a SharePoint timer job/webpart ) to read and present data.
    However, if you can reduce the excel file records to something near 16k (which is supported rows in web version of excel) then you can use SharePoint Excel service to refresh data automatically in the excel file in SharePoint from some external sources.
    Thanks,
    Sohel Rana
    http://ranaictiu-technicalblog.blogspot.com

  • Custom Report : What is the best way ?

    Hi!
    My customer doesn't like native TestStand 's report layout. He would prefer something like the example enclosed to this post.
    What is the best way to achieve this ?
    XSL customizing (seems heavy work) ?
    Using the report generation toolkit  and a Word template ?
    Any other idea ?
    Attachments:
    Report Style.JPG ‏115 KB

    Have you examined all of the examples found in the TestStand help:

  • I have an old 30" apple cinema display (2005) I want to use as a 2nd monitor to a new iMac (2012).  I don't just want mirror image of iMac; what's the best way to do this?

    I have not bought the iMac yet but will do so very soon and just want to make sure I have what I need to get everything setup including adding the old faithful 2005 30" cinema display.  Currently I am driving the old 30" cinema display with a macbook pro also purchased 2005 and happy to say I got a lot of good miles out of this rig.  What's the best way to connect the old 30" monitor as a second display for the new generation iMacs?
    Other Questions
    I can find online new in unopened box a 2012 iMac 27" i7 with 1T Fusion Drive for $1899 no sales tax.  This seems like a pretty good deal since I notice the same is available from Apple refurbished for $100 more plus sales tax.  I know that they say the Fusion drive is a lot faster on 2013 models but some of the speed tests I reviewed online showed the 2012 i7 and 2013 i7 very close on speed for both storage and processing.  Any thoughts?
    I don't like changing batteries so I would buy a separate Apple keyboard with numeric pad since it only comes with wireless keyboard.  I'm a trackpad enthusiast having been using my macbook pro trackpad with current set up; and I am prepared to buy the Apple trackpad and replace batteries every 2 months but I would greatly prefer USB connection and rechargeable trackpact.  I know Logitech makes one so if anyone is using and knows how it compares to Apple's I'm all ears. 

    <http://support.apple.com/kb/HT5891>
    You can use USB for the Apple trackpad.
    <http://www.mobeetechnology.com/the-power-bar.html>

  • I am trying to rebuild my iPhoto library and noticed my backup contains aliases (pointers?) and not the actual file. What's the best way to rebuild my library?

    I am trying to rebuild my iPhoto library and noticed my backup contains aliases (pointers?) and not the actual file. What's the best way to rebuild my library?
    Facts:
    In moving to a new iMac, I copied the iPhoto library to an external HDD assuming that I would point the new iMac to the backed up iPhoto Library
    All worked fine when I pointed the new library but noticed that some folders contained aliases and not the original file. So when I attempt to open that photo it can't find it because the alias is pointing to another drive.
    I do have all original photos from a couple of external HDDs. In the folders titled, "Originals" (from older versions of iPhoto) and "Masters" (from current iPhoto)
    I'm thinking I can create a new folder and drop the original files and make that my new iPhoto library. Is there a better way to rebuild my library? I do not want to create any future aliases.
    Thanks in advance for any help!

    do you have a strongly recommended default "managed" library (the iPhoto preference to "copy imported items to the iPhoto library is in its checked state) or a referenced library - you have unchecked that option?
    It sounds like you have a referenced library and are now experiancing one of the very siginificant drawbacks of a referenced library and one of the many reasons they are strongly not recommended
    Also note that iPhoto '11 may use alises in the originals folder as part of the upgrade
    It is important that we understand exactly what you have and what is not sorking - what error messages you are getting
    You must NEVER make any changes of any sort to the structure of content of the iPhoto library - there are no user servicable parts in it  --  and you can not rebuild yoru librtary - only iPhoto ir iPhoto Library Manager - http://www.fatcatsoftware.com/iplm/ -  can rebuild a library unless you are a SQL programmer and understand the structure that iPhoto uses
    LN

  • What is the best way to open emails and attachments without using wifi?

    For I-phone and I-pad, what is the best way to open emails and attachments without using wifi?  I turned off wifi in my settings but my boss thinks there may be another way and a better way to use something else instead of wifi.  Any help would be appreciated!  Thank you!

    Thanks!  That is a very good question you post.  My boss asked me that and I am assuming that he is having issues with using wifi wherever he is at.  My boss is the kind of person that when he asks something you look into it and ask him no questions...he's the only one asking questions!  But thank you for your response I will tell him the information you told me and hopefully that will help!

  • What is the best way to open a HTTPS connection?

    What is the best way to open a HTTPS connection and retrieve the content as XML? This is how most of the online API is done nowadays, how can this be done on the iphone SDK?
    Thanks

    Have a look at the SeismicXML example that comes with the iPhone SDK. It uses http instead of https but it may work for you.
    You can also look at the NSURLRequest and NSURLConnection classes.
    Enjoy.

  • What is the best way to work with Word documents in The InDesign CS4???

    I work in Microsoft Word 2007 and all my documents have *.doc format.
    What is the best way to work with Word documents in InDesign CS4???
    David Blatner says to avoid copying and pasting text from Word instead of placing it (Ctrl+D).
    How about pasting RTF or Text Document???
    I want to make book's layout in ID CS4 and its main feature is that there is the left page with text and the right - with graphics.
    So, as I understand to place the text on each page I must create for example 70 Word documents and place each item on 70 left pages???
    It loks like wasting time. I sthere another way of making such layout???  What kind????

    It's best to place any text.
    You can have all of your text in one file and use auto-flow to add threaded text frames and pages as required (Hold down the Shift key when you click the loaded text cursor), but it's a little non-standard to have the thread only on one side of the spread from the auto-flow perspective, so you'll have to set up properly.
    This is one case where a master text frame will work to your advantage. On your master page spread, add a text frame to the left page, but not to the right (or at least not threaded to one on the right -- for some other project you might actually want two independent text threads). Hold the loaded cursor over a frame on the left side of a document page and auto-flow. ID will add new spreads as necessary, but only put the text on the left side.
    Peter

  • What is the best way to verify default heap size in Java

    Hi All,
    What is the best way to verify default heap size in Java ? does it vary over JVM to JVM . I was reading this article http://javarevisited.blogspot.sg/2011/05/java-heap-space-memory-size-jvm.html , and it says default size is 128 MB but When I run following code :
    public static void main(String args[]) {
    int MB = 1024*1024;
    System.out.println(Runtime.getRuntime().totalMemory()/MB);
    It print "870" i.e. 870 MB.
    I am bit confused, what is the best way to verify default heap size in any JVM ?
    Edited by: 938864 on Jun 5, 2012 11:16 PM

    938864 wrote:
    Hi Kayaman,
    Sorry but I don't agree with you on verification part, Why not I can verify it ? to me default means value when I don't specify -Xms and -Xmx and by the way I was testing that program on 32 bit JRE 1.6 on Windows. I am also curious significant difference between 128MB and 870MB I saw, do you see anything obviously wrong ?That spec is outdated. Since Java 6 update 18 (Sun/Oracle implementation) the default maximum heap space is calculated based on total memory availability, but never more than 1GB on 32 bits JVMs / client VMs. On a 64 bits server VM the default can go as high as 32gb.
    The best way to verify ANYTHING is to address multiple sources of information and especially those produced by the source, not some page you find on the big bad internet. Even wikipedia is a whole lot better than any random internet site IMO. That's common sense, I can't believe you put much thought into it that you have to ask in a forum.

  • What is the best way to make a HDMI connection?

    I have a 13" Macbook Pro, bought in late 2011, therefore I have the Thunderbolt port. I do not think it has a mini DVI port. Therefore my question is what is the best way to connect this great Mac to a HDTV using an HDMI port on the TV?

    To connect MBP to HDMI monitor or TV via Thunderbolt port, use mini DisplayPort-to-HDMI adapter and HDMI cable. Thunderbolt port is mini-DisplayPort compatible. If you get the adaptor that supports video and audio signal, both will be forwarded to your monitor or TV. Search the Apple store.

Maybe you are looking for

  • How to display page no for different master pages in one adobe form application

    Hi All, we have requirement where we need to  display page nos in different master pages in one single adobe form. For the First form the page nos should be displayed pgno of total pages and for 2nd form the page no shuld be displayed as pgno of tota

  • Weird video display in FCP but normal in QT

    Okay, this is getting really tiresome now. Final Cut Studio has become weird on an Intel Core Duo iMac. When the symptoms first appeared FCP would not launch at all. It would quit on startup with a window to send a report to Apple. On that occasion I

  • Error when changing the POV period of a recurring journal

    We recently upgraded from HFM 9.3.1 to 11.1.1.3 and are going through our first monthly close with the upgraded application. Everything had been working fine until today when one of the application administrators attempted to post a recurring journal

  • Can't upgrade or uninstall iTunes due to: The folder My Music contains an invalid character!

    Hi,      Something went wrong when i tried to upgrade to 10.5 and now I can't use iTunes. It says that the folder My Music contains an invalid character and although I've tried uninstalling all apple software and re-installing I can't uninstall/repai

  • Slow New MacBook Pro and Migration

    Are there pros and cons to using the Setup Assistant to migrate files and applications from an older computer? I migrated my system from a PowerBook G4 to my brand-new MBPro. I've noticed that recently I'm getting some very s-l-o-w performance. Could