Simple xerces DOMParser.  Why won't this validate? Very simple, xml schema

I have written a java program called "Validate.java" to validate an xml file. The program uses the xerces DOMParser. When I try and validate a correct .xml file with a correct schema in an .xsd file I get the following errors:
[Error] Document is invalid: no grammar found. line 2 column 6 - name5.xml
[Error] Document root element "name", must match DOCTYPE root "null". line 2 column 6 - name5.xmlThe XML file, the XSD file, and the Validate.java program are all in the same directory. My CLASSPATH includes xml-apis.jar, xercesImpl.jar, and xercesSamples.jar.
Here is the xml file (name5.xml):
<?xml version="1.0"?>
<name
    xmlns="http://www.myOwnURL.net/name"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.myOwnURL.net/name name5.xsd"
    title="Mr.">
  <first>John</first>
  <middle>Fitzgerald</middle>
  <last>Doe</last>
</name>(I saved the file in the UTF-8 encoding, which causes it to look double spaced in some text editors.)
The schema is in the following xsd file (name5.xsd):
<?xml version="1.0"?>
<schema
    xmlns="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://www.myOwnURL.net/name"
    xmlns:target="http://www.myOwnURL.net/name"
    elementFormDefault="qualified">
  <element name="name">
    <complexType>
      <sequence>
        <element name="first" type="string"/>
        <element name="middle" type="string"/>
        <element name="last" type="string"/>
      </sequence>
      <attribute name="title" type="string"/>
    </complexType>
  </element>
</schema>(Again, the file is saved in UTF-8 format.)
Here is the code for Validate.java:
public class Validate implements org.xml.sax.ErrorHandler
    private String instance = null;
    private int warnings = 0;
    private int errors = 0;
    private int fatalErrors = 0;
    private org.apache.xerces.parsers.DOMParser parser = new org.apache.xerces.parsers.DOMParser();
    public Validate() // constructor
        parser.setErrorHandler(this); // Set the errorHandler
    public void setInstance(String s)
        instance = s;
    public boolean doValidate()
        try
            warnings = 0;
            errors = 0;
            fatalErrors = 0;
            try
                // Turn the validation feature on
                parser.setFeature( "http://xml.org/sax/features/validation", true);
                // Parse and validate
                System.out.println("Validating source document...");
                parser.parse(instance);
                // We parsed... let's give some summary info of what we did
                System.out.println("\nComplete " + warnings + " warnings " + errors + " errors " + fatalErrors + " fatal errors");
                // Return true if we made it this far with no errors
                return ((errors == 0) && (fatalErrors == 0));
            catch (org.xml.sax.SAXException e)
                System.err.println("\nCould not activate validation features - " + e.getMessage());
                return false;
        catch (Exception e)
            System.err.println("\n"+e.getMessage());
            return false;
    public void warning(org.xml.sax.SAXParseException ex)
        System.err.println("\n[Warning] " + ex.getMessage() + " line " + ex.getLineNumber()
        + " column " + ex.getColumnNumber() + " - " + instance);
        warnings++;
    public void error(org.xml.sax.SAXParseException ex)
        System.err.println("\n[Error] " + ex.getMessage() + " line " + ex.getLineNumber()
        + " column " + ex.getColumnNumber() + " - " + instance);
        errors++;
    public void fatalError(org.xml.sax.SAXParseException ex) throws org.xml.sax.SAXException
        System.err.println("\n[Fatal Error] " + ex.getMessage() + " line " + ex.getLineNumber()
        + " column " + ex.getColumnNumber() + " - " + instance);
        fatalErrors++;
        throw ex;
    public static void main(String[] args)
        Validate validate1 = new Validate();
        if (args.length == 0)
            System.out.println("Usage : java Validate <instance>");
            return;
        // Set the instance
        if (args.length >= 1) validate1.setInstance(args[0]);
        // Validate (the doValidate returns either true or false depending on
        // whether there were any errors.)
        if (!validate1.doValidate()) return;
}My question is: why do I get those errors??? Why doesn't everything just validate like it is supposed to??? Also, why does the error even mention DOCTYPE -- I thought that was for DTDs, and I am using XML Schema.
I will be very grateful to anyone who can tell me what is going on here.
Thanks,
Jon

I have solved my problem. I just needed to add the following line to my java program:
parser.setFeature("http://apache.org/xml/features/validation/schema", true);I'm still not sure how I was supposed to know this, however. I guess spending three hours searching on google is what you are supposed to do. Also, I was thrown for a bit of a loop by the following official faq found at http://xml.apache.org/xerces2-j/faq-pcfp.html:
[faq]
Question: How can I tell the parser to validate against XML Schema and not to report DTD validation errors?
Answer: Currently this is impossible. We hope that JAXP 1.2 will provide this capability via its schema language property. Otherwise, we might introduce a Xerces language property that will allow specifying the language against which validation will occur.
[faq]
I am very new to XML (less than a week), but that FAQ sure makes it sound like using only XML Schema and completely avoiding DTDs is impossible. On the other hand, I think that is what I was able to achieve by adding the above line to my code.
Oh well.
Jon

Similar Messages

  • Functions in a For Loop defining objects from an Array. . .Why Won't This Work?!

    I'm trying to put these functions into a Loop to conserve
    space. Why won't this work?
    .

    Yeah, sly one is right. You can not have the "i" inside the
    onRollOver function, what you have to do is: As the movieClip class
    is dynamic you can create a property of the movieClip which stores
    the value if the "i". And then, inside the onRollOver function, you
    have to make reference to that property.
    for (i=0; i<2; i++) {
    this.regArray
    .iterator = i;
    this.regArray.onRollOver = function () {
    showRegion(regArray[this.iterator]);
    this.regArray
    .onRollOut = function () {
    hideRegion(regArray[this.iterator]);

  • Help...Why won't this compile?

    Why won't this compile?
    Here is my code:
    import java.util.Calendar;
    import javax.swing.JOptionPane;
    public class GetAge{
    public static void main(String[] args){
    int month=Integer.parseInt(JOptionPane.showInputDialog
    (null,"Enter what month(MM) you were born:"));
    int day=Integer.parseInt(JOptionPane.showInputDialog
    (null,"Enter what day(dd) you were born:"));
    int year=Integer.parseInt(JOptionPane.showInputDialog
    (null,"Enter what year(yyyy) you were born:"));
    Calendar rightNow = Calendar.getInstance();
    int year2 = rightNow.get(Calendar.YEAR);
    int day2 = rightNow.get(Calendar.DATE);
    int month2 = rightNow.get(Calendar.MONTH)+1;
    int years = year2-year-1;
    int months = month2-month+12;
    if(day2 >= day)
       int days = day2-day;
    else
       days = day-day2+8;
    JOptionPane.showMessageDialog(null,"You are: " + years
    + " years " + months + " months and " + days + " days old.");
    }

    What you're doing is using days after the if statement; without curly braces only a valid statement is allowed.
    But if you add curly braces, days will be available only in the if block.
    So what you should do is:
    import java.util.Calendar;
    import javax.swing.JOptionPane;
    public class GetAge{
    public static void main(String[] args){
    int month=Integer.parseInt(JOptionPane.showInputDialog
    (null,"Enter what month(MM) you were born:"));
    int day=Integer.parseInt(JOptionPane.showInputDialog
    (null,"Enter what day(dd) you were born:"));
    int year=Integer.parseInt(JOptionPane.showInputDialog
    (null,"Enter what year(yyyy) you were born:"));
    Calendar rightNow = Calendar.getInstance();
    int year2 = rightNow.get(Calendar.YEAR);
    int day2 = rightNow.get(Calendar.DATE);
    int month2 = rightNow.get(Calendar.MONTH)+1;
    int years = year2-year-1;
    int months = month2-month+12;
    int days = 0;      //declare here
    if(day2 >= day)
       days = day2-day;  //...and use here
    else
       days = day-day2+8;   //..and here
    JOptionPane.showMessageDialog(null,"You are: " + years
    + " years " + months + " months and " + days + " days old.");
    }

  • I purchased the new gen 7 ipod nano and needed to update itunes to 10.7 but my current software says its up to date and won't download 10.6.8 Currently I have 10.5.8 Why won't this update?

    I purchased the new gen 7 ipod nano and needed to update itunes to 10.7 but my current software says its up to date and won't download 10.6.8 Currently I have 10.5.8 Why won't this update?

    The first generation Intel-based Mac's were released in January 2006.
    Snow Leopard requires an Intel processor:
    General requirements
    Mac computer with an Intel processor
    1GB of memory
    5GB of available disk space
    DVD drive for installation
    Some features require a compatible Internet service provider; fees may apply.
    If you go to the Apple menu & "About this Mac" this will tell you what type of processor you have:

  • Why won't this song play even after I authorized the computer? It says that I need to authorize the computer, then I enter my username and password and it says the computer is already authorized. But then the song still won't play. What do I do?

    Why won't this song play even after I authorized the computer? It says that I need to authorize the computer, then I enter my username and password and it says the computer is already authorized. But then the song still won't play. What do I do?

    Use the Apple ID support -> http://www.apple.com/support/appleid/ - click through the contact information and select the iTunes, etc., hot button. You can have Apple call you or email them.
    Clinton

  • Why won't this code work?

    All I want to do is resize the select panel to the same size as east panel. Why won't it work?
    Space.java_____________________________________________
    import javax.sound.sampled.*;
    import java.awt.*;
    import javax.sound.midi.*;
    import javax.swing.*;
    import java.util.*;
    import java.awt.event.*;
    import java.io.*;
    public class Space extends JFrame implements ActionListener, Runnable{
         //Sound
         Sequence currentSound;
         Sequencer player;
         Thread soundCheck;
         boolean check = true;
         public void start(){
              soundCheck = new Thread();
              soundCheck.start();
         public void run(){
              try{
                   File bgsound = new File("Sounds" + File.separator + "Space.mid");
                   currentSound = MidiSystem.getSequence(bgsound);
                   player = MidiSystem.getSequencer();
                   player.open();
                   player.setSequence(currentSound);
                   player.start();
                   checkSound();
              } catch (Exception exc){}
         public void checkSound(){
              while(check){
                   if(!player.isRunning()){
                     run();
                   try{
                        soundCheck.sleep((player.getMicrosecondLength() / 1000)-player.getMicrosecondPosition()); // sleep for the length of the track
                   }catch (InterruptedException IE){}
         //Screen Variables:
         Dimension SCREEN = Toolkit.getDefaultToolkit().getScreenSize();
         final int SCREENWIDTH = SCREEN.width;
         final int SCREENHEIGHT = SCREEN.height;
         //Panels:
         JPanel select, main, north, south, east;
        //Buttons:
         JButton instructB, cheatB, playB, exit, about;
         //Labels:
         JLabel open, cheat1, cheat2, cheatInstruct, i1, i2 , i3, aboutLabel;
         //The container and frame:
         static Space jframe;
         Container content;
         //The Constructor:
         public Space(){
              super("Space");
              //set  container attributes:
              content = getContentPane();
              content.setLayout(new BorderLayout());
              //init panels:
              main   = new JPanel();
              select = new JPanel();
              north  = new JPanel();
              east   = new JPanel();
              south  = new JPanel();
              //set panel attributes:
              select.setLayout(new GridLayout(3,0,10,10));     
              select.setBackground(Color.black);
              main.setBackground(Color.black);
              north.setBackground(Color.black);
              //add panels:
              content.add("West", select);
              content.add("Center", main);
              content.add("North", north);
              content.add("East", east);
              //Image Icons:
              Icon exit1 = new ImageIcon("Images" + File.separator + "exit1.gif");
              Icon exit2 = new ImageIcon("Images" + File.separator + "exit2.gif");
              Icon about1 = new ImageIcon("Images" + File.separator + "about1.gif");
              Icon about2 = new ImageIcon("Images" + File.separator + "about2.gif");
              //init buttons, add their listeners, and set their attributes:
              instructB = new JButton("Instructions", new ImageIcon("Images" + File.separator + "ship.gif"));
              instructB.setContentAreaFilled(false);
              instructB.setForeground(Color.yellow);
              instructB.addActionListener(this);
              select.add(instructB);
              cheatB = new JButton("Cheats", new ImageIcon("Images" + File.separator + "cheat.gif"));
              cheatB.setContentAreaFilled(false);
              cheatB.setForeground(Color.yellow);
              cheatB.addActionListener(this);
              select.add(cheatB);
              playB = new JButton("Play", new ImageIcon("Images" + File.separator + "ship2.gif"));
              playB.setContentAreaFilled(false);
              playB.setForeground(Color.yellow);
              playB.addActionListener(this);
              select.add(playB);          
              exit = new JButton();
              exit.setRolloverEnabled(true);
              exit.setIcon(exit1);
              exit.setRolloverIcon(exit2);
              exit.setBorderPainted(false);
              exit.setContentAreaFilled(false);
              exit.addActionListener(this);
              north.add(exit);
              about = new JButton();
              about.setRolloverEnabled(true);
              about.setIcon(about1);
              about.setRolloverIcon(about2);
              about.setBorderPainted(false);
              about.setContentAreaFilled(false);
              about.addActionListener(this);
             north.add(about);
             //Labels:
             open = new JLabel("", new ImageIcon("Images" + File.separator + "open.gif"), JLabel.CENTER);
              main.add(open);
              cheat1 = new JLabel("<html><h1>tport</h1></html>");
              cheat1.setForeground(Color.red);
              cheat2 = new JLabel("<html><h1>zap</h1></html>");
              cheat2.setForeground(Color.green);
              cheatInstruct = new JLabel("<html><h1>Type a cheat at any time during a game, and press the \"Enter\" key.</html></h1>");
              cheatInstruct.setForeground(Color.blue);     
              i1 = new JLabel("<html><h1>The arrow keys move your ship.</h1></html>");
              i1.setForeground(Color.red);
              i2 = new JLabel("<html><h1>The space-bar fires the gun.</h1></html>");
              i2.setForeground(Color.green);
              i3 = new JLabel("<html><h1>The red circles give upgrades.</html></h1>");
              i3.setForeground(Color.blue);
              aboutLabel    = new JLabel("", new ImageIcon("Images" + File.separator + "aboutImage.gif"), JLabel.CENTER);
              //centerPanel();     
         private void centerPanel(final int width, final int height){
              try{
                   Runnable setPanelSize = new Runnable(){
                        public void run(){
                             east.setPreferredSize(new Dimension(width, height));                    
                   SwingUtilities.invokeAndWait(setPanelSize);
              } catch (Exception e){}
         public void actionPerformed(ActionEvent e){
              //if the play button was pressed do:
              if(e.getSource() == playB){
                  //do something
             //else if the cheat button was pressed do:
              else if(e.getSource() == cheatB){
                   //remove and add components
                   main.removeAll();
                   main.setLayout(new GridLayout(3,0,0,0));
                   main.add(cheat1);
                   main.add(cheat2);
                   main.add(cheatInstruct);
                   main.repaint();
                   main.validate();          
              else if(e.getSource() == instructB){
                   //remove and add components
                   main.removeAll();
                   main.setLayout(new GridLayout(3,0,0,0));
                   main.add(i1);
                   main.add(i2);
                   main.add(i3);
                   main.repaint();
                   main.validate();          
              else if(e.getSource() == exit){
                   jframe.setVisible(false);
                   showCredits();          
              else if(e.getSource() == about){
                   main.removeAll();
                   main.setLayout(new FlowLayout());
                   main.add(aboutLabel);                         
                   main.repaint();
                   main.validate();
         public void showCredits(){
              try{
                   String[] args = {};
                   Credits.main(args);
              }catch (Exception e){}
         public static void main(String args[]){
              jframe = new Space();
              jframe.setUndecorated(true);
              jframe.setBounds(0, 0, jframe.SCREENWIDTH, jframe.SCREENHEIGHT);
              jframe.setVisible(true);
            jframe.show();     
            jframe.setResizable(false);
               jframe.setDefaultCloseOperation(EXIT_ON_CLOSE);
             jframe.centerPanel(jframe.select.getWidth(), jframe.select.getHeight());
             jframe.run(); //start music

    The reason it wasn't working was because you were calling the method after you had set the frame visible, so you saw no change. On top of that, jframe.select.getWidth() only works after the frame is visible in this case. So it's best to set a fixed size for one of them, then use getWidth, or as I did... it's the same thing. I also changed the centerPanel method, I'm not sure if all that's exactly needed, but you can change it back if you think you'll need it.
    import javax.sound.sampled.*;
    import java.awt.*;
    import javax.sound.midi.*;
    import javax.swing.*;
    import java.util.*;
    import java.awt.event.*;
    import java.io.*;
    public class Space extends JFrame implements ActionListener, Runnable{
    //Sound
    Sequence currentSound;
    Sequencer player;
    Thread soundCheck;
    boolean check = true;
    public void start(){
    soundCheck = new Thread();
    soundCheck.start();
    public void run(){
    try{
    File bgsound = new File("Sounds" + File.separator + "Space.mid");
    currentSound = MidiSystem.getSequence(bgsound);
    player = MidiSystem.getSequencer();
    player.open();
    player.setSequence(currentSound);
    player.start();
    checkSound();
    } catch (Exception exc){}
    public void checkSound(){
    while(check){
    if(!player.isRunning()){
                run();
    try{
    soundCheck.sleep((player.getMicrosecondLength() / 1000)-player.getMicrosecondPosition()); // sleep for the length of the track
    }catch (InterruptedException IE){}
    //Screen Variables:
    Dimension SCREEN = Toolkit.getDefaultToolkit().getScreenSize();
    final int SCREENWIDTH = SCREEN.width;
    final int SCREENHEIGHT = SCREEN.height;
    //Panels:
    JPanel select, main, north, south, east;
        //Buttons:
    JButton instructB, cheatB, playB, exit, about;
    //Labels:
    JLabel open, cheat1, cheat2, cheatInstruct, i1, i2 , i3, aboutLabel;
    //The container and frame:
    static Space jframe;
    Container content;
    //The Constructor:
    public Space(){
    super("Space");
    //set  container attributes:
    content = getContentPane();
    content.setLayout(new BorderLayout());
    //init panels:
    main   = new JPanel();
    select = new JPanel();
    north  = new JPanel();
    east   = new JPanel();
    south  = new JPanel();
    //set panel attributes:
    select.setLayout(new GridLayout(3,0,10,10));
    select.setBackground(Color.black);
    main.setBackground(Color.black);
    north.setBackground(Color.black);
    //add panels:
    content.add("West", select);
    content.add("Center", main);
    content.add("North", north);
    content.add("East", east);
    //Image Icons:
    Icon exit1 = new ImageIcon("Images" + File.separator + "exit1.gif");
    Icon exit2 = new ImageIcon("Images" + File.separator + "exit2.gif");
    Icon about1 = new ImageIcon("Images" + File.separator + "about1.gif");
    Icon about2 = new ImageIcon("Images" + File.separator + "about2.gif");
    //init buttons, add their listeners, and set their attributes:
    instructB = new JButton("Instructions", new ImageIcon("Images" + File.separator + "ship.gif"));
    instructB.setContentAreaFilled(false);
    instructB.setForeground(Color.yellow);
    instructB.addActionListener(this);
    select.add(instructB);
    cheatB = new JButton("Cheats", new ImageIcon("Images" + File.separator + "cheat.gif"));
    cheatB.setContentAreaFilled(false);
    cheatB.setForeground(Color.yellow);
    cheatB.addActionListener(this);
    select.add(cheatB);
    playB = new JButton("Play", new ImageIcon("Images" + File.separator + "ship2.gif"));
    playB.setContentAreaFilled(false);
    playB.setForeground(Color.yellow);
    playB.addActionListener(this);
    select.add(playB);
    exit = new JButton();
    exit.setRolloverEnabled(true);
    exit.setIcon(exit1);
    exit.setRolloverIcon(exit2);
    exit.setBorderPainted(false);
    exit.setContentAreaFilled(false);
    exit.addActionListener(this);
    north.add(exit);
    about = new JButton();
    about.setRolloverEnabled(true);
    about.setIcon(about1);
    about.setRolloverIcon(about2);
    about.setBorderPainted(false);
    about.setContentAreaFilled(false);
    about.addActionListener(this);
        north.add(about);
        //Labels:
        open = new JLabel("", new ImageIcon("Images" + File.separator + "open.gif"), JLabel.CENTER);
    main.add(open);
    cheat1 = new JLabel("<html><h1>tport</h1></html>");
    cheat1.setForeground(Color.red);
    cheat2 = new JLabel("<html><h1>zap</h1></html>");
    cheat2.setForeground(Color.green);
    cheatInstruct = new JLabel("<html><h1>Type a cheat at any time during a game, and press the \"Enter\" key.</html></h1>");
    cheatInstruct.setForeground(Color.blue);
    i1 = new JLabel("<html><h1>The arrow keys move your ship.</h1></html>");
    i1.setForeground(Color.red);
    i2 = new JLabel("<html><h1>The space-bar fires the gun.</h1></html>");
    i2.setForeground(Color.green);
    i3 = new JLabel("<html><h1>The red circles give upgrades.</html></h1>");
    i3.setForeground(Color.blue);
    aboutLabel    = new JLabel("", new ImageIcon("Images" + File.separator + "aboutImage.gif"), JLabel.CENTER);
    east.setPreferredSize(new Dimension(125, SCREEN.width));
    //centerPanel();
    /*private void centerPanel(final int width, final int height){
    try{
    Runnable setPanelSize = new Runnable(){
    public void run(){
    east.setPreferredSize(new Dimension(width, height));
    SwingUtilities.invokeAndWait(setPanelSize);
    } catch (Exception e){}
    private void centerPanel(final int width, final int height)
         east.setPreferredSize(new Dimension(width, height));
    public void actionPerformed(ActionEvent e){
    //if the play button was pressed do:
    if(e.getSource() == playB){
        //do something
        //else if the cheat button was pressed do:
    else if(e.getSource() == cheatB){
    //remove and add components
    main.removeAll();
    main.setLayout(new GridLayout(3,0,0,0));
    main.add(cheat1);
    main.add(cheat2);
    main.add(cheatInstruct);
    main.repaint();
    main.validate();
    else if(e.getSource() == instructB){
    //remove and add components
    main.removeAll();
    main.setLayout(new GridLayout(3,0,0,0));
    main.add(i1);
    main.add(i2);
    main.add(i3);
    main.repaint();
    main.validate();
    else if(e.getSource() == exit){
    jframe.setVisible(false);
    //showCredits();
    else if(e.getSource() == about){
    main.removeAll();
    main.setLayout(new FlowLayout());
    main.add(aboutLabel);
    main.repaint();
    main.validate();
    /*public void showCredits(){
    try{
    String[] args = {};
    Credits.main(args);
    }catch (Exception e){}
    public static void main(String args[]){
    jframe = new Space();
    //jframe.centerPanel(500, jframe.select.getHeight());
    jframe.setUndecorated(true);
    jframe.setBounds(0, 0, jframe.SCREENWIDTH, jframe.SCREENHEIGHT);
    jframe.setVisible(true);
            jframe.show();
            jframe.setResizable(false);
          jframe.setDefaultCloseOperation(EXIT_ON_CLOSE);
        //jframe.centerPanel(jframe.select.getWidth(), jframe.select.getHeight());
        jframe.run(); //start music
    }Sorry I lost all the indenting :) I guess you can take a look at the few lines I changed and copy those lines.

  • Why won't this form submit?

    Why won't the form on this page submit?
    www.milesmemorials.com/contact.html
    Php for this form is-
    <?php
    $name = $_POST['name'];
    $visitor_email = $_POST['email'];
    $message = $_POST['message'];
    //Validate first
    if(empty($name)||empty($visitor_email))
        echo "Name and email are mandatory!";
        exit;
    if(IsInjected($visitor_email))
        echo "Bad email value!";
        exit;
    $email_from = "milesmemorials.com";//<== update the email address
    $email_subject = "Message from Miles Memorial contact form";
    $email_body = "Visitors name: $name.\n".
         "Message:\n $message".
    $to = "[email protected]";//<== update the email address
    $headers = 'From: '.$visitor_email."\r\n";
    $headers .='Reply-To:'.$visitor_email."\r\n";
    //Send the email!
    mail($to,$email_subject,$email_body,$headers);
    //done. redirect to thank-you page.
    header('Location: thankyou.html');
    // Function to validate against any email injection attempts
    function IsInjected($str)
      $injections = array('(\n+)',
                  '(\r+)',
                  '(\t+)',
                  '(%0A+)',
                  '(%0D+)',
                  '(%08+)',
                  '(%09+)'
      $inject = join('|', $injections);
      $inject = "/$inject/i";
      if(preg_match($inject,$str))
        return true;
      else
        return false;
    ?>

    >I do apologise if i seem slow, i am still very new to dreamweaver
    Just to be clear, this is not an issue with learning dreamweaver. This is just a lack of understanding of HTML and PHP. You need to learn those first before trying to learn DW.
    You have a form field named 'donorName' but are checking for a field named 'name'.
    $name = $_POST['name'];
    <input name="donerName" type="text"
    You need to rename one or the other.

  • Consolidate Library - why won't this work?

    Hi there,
    I've been using iTunes and my iPod on several iMacs successfully for years - I've just changed to a PC and now I feel like a beginner!
    I can't seem to get iTunes for Windows to seek out all my MP3s and put them in iTunes. The only way I can get iTunes to put them in it's library is to play them - then iTunes recognises then and remebers them. I have tried clicking on consolidate library - nothing. I have tried downloading my new music directly into the iTunes music folder - nothing. I can maunally add the file I download music into, but I don't want to have to do that all the time.
    Why won't iTunes just find my music for me? It does on my iMac!

    I dont know!
    In what way is it not working?

  • We are unable to validate this serial number for CS6 Design Standart. What's wrong with my key or why won't it validate?

    I bought the CS6 Design Standard student and teacher edition over amazon. I activated the product on my adobe account and got a serial number. But when I install the package and enter the serial number I a message saying "We are unable to validate this serial number for Creative Suit 6 Design Standard. Please contact Customer Support."
    Does anyone know what is up with this? I am sure that the problem isn't anything along the lines of making mistakes when typing in the serial (tried it multiple times, used copy paste to reduce chance of error). It's also not any problem with me lacking an internet connection adobe to validate the serial.

    Serial number questions can't be handled on the forums. You'll need to talk to Customer Support either by phone or web chat.
    http://helpx.adobe.com/contact.html

  • Why won't this show (same) four pages in the Adobe Reader?

    %PDF-1.6
    3 0 obj
    <</Type /Font /BaseFont /Times-Italic /Subtype /Type1 >>
    endobj
    6 0 obj
    <</Length 158 >>
    stream
    1 0 0 1 50 200 cm /X1 Do
    1 0 0 1 0   200 cm /X1 Do
    1 0 0 1 0   200 cm /X1 Do
    1 0 0 1 200 -400 cm /X1 Do
    1 0 0 1 0 200 cm /X1 Do
    1 0 0 1 0 200 cm /X1 Do
    endstream
    endobj
    4 0 obj
    <</Type /XObject /Subtype /Form /BBox [0 0 1000 1000] /Resources <</Font <</F1 3 0 R>> >>
    /Length 77 >>
    stream
    BT /F1 18 Tf 0 0 Td (18 Point) Tj ET
    BT /F1 25 Tf 0 50 Td (25 Point) Tj ET
    endstream
    endobj
    5 0 obj
    <</Type /Page /Parent 2 0 R /Contents 6 0 R /MediaBox [0 0 595.27 841.88] /UserUnit 0.5 /Resources <</XObject <</X1 4 0 R>> >>
    >>
    endobj
    2 0 obj
    <</Type /Pages /Kids [5 0 R 5 0 R 5 0 R 5 0 R ] /Count 4 >>
    endobj
    1 0 obj
    <</Type /Catalog /Pages 2 0 R >>
    endobj
    xref
    0 7
    0000000000 65535 f
    0000000745 00000 n
    0000000667 00000 n
    0000000010 00000 n
    0000000297 00000 n
    0000000517 00000 n
    0000000085 00000 n
    trailer
    <<
    /Root 1 0 R
    /Size 7
    >>
    startxref
    796
    %%EOF
    Works OK with Chrome's reader......

    1. It may surprise you, but more than 50% of the problems which people ask about with PDF generators turn out to be related to the exact byte layout, and disappear (or get worse) with copy/paste. People with tools for PDF examination like to be able to use them and know they are working on the exact/same file.
    "But why can it not do that."
    Because the question is unanswerable. Imagine an API call
    PageObjectGetPageNumber().
    Given object 5 0 R and asking for the page number, what is the correct answer - 1, 2, 3, or 4? This is of more than academic interest. For example, the page object might be the destination of a link, and an interactive viewer needs to know which page to navigate to. So, while a simple PDF viewer could display it, many things might not work.
    ISO 32000-1 doesn't forbid it. But there isn't much mileage in taking the high ground and saying that one is making good files but Acrobat isn't compliant.

  • Why won't this scriipt work with Firefox? embed src="News2008Fall.pdf" width="615" height="3200" /embed

    Please tell me why this script won't work with Firefox. It works with Safari. Here is the page that includes the script: www.lionsgatehoa.org/newslettertest.html. Thank you. Tom Engleman
    Here is the script in my html document:
    <embed src="News2008Fall.pdf" width="615" height="3200"></embed>
    edit: removed phone #

    Works for me on Linux.<br />
    Your system details list doesn't show the Adobe Reader plugin, so you will have to (re)install that program.
    See:
    *https://support.mozilla.org/kb/Using+the+Adobe+Reader+plugin+with+Firefox
    *http://kb.mozillazine.org/Adobe_Reader
    *http://get.adobe.com/reader/otherversions/

  • Why won't this MERGE statement work?

    I am testing out a MERGE statement, which contains a subquery that will return no rows...on this condition, it should insert a record; however I get 0 records merged. Why is this?
    Ultimately, the hard-coded values will actually be passed in as parameters. If those a record with those four values is not found, then it should insert.
    MERGE INTO tb_slea_election_worksheet A
    USING 
    (SELECT i.slea_year,i.empid,i.bda_sum_sort,i.bda_dtl_sort FROM tb_slea_election_worksheet i
    WHERE  slea_year = '2008'
    AND empid = '6468T'
    AND bda_sum_sort = '30'
    AND bda_dtl_sort = '9999'
    ) B
    ON (A.slea_year = B.slea_year
    AND A.empid =B.empid
    AND A.bda_sum_sort  = B.bda_sum_sort
    AND A.bda_dtl_sort  = B.bda_dtl_sort) 
    WHEN MATCHED THEN
      UPDATE SET A.fa_proj_exp_amt  = 888
    WHEN NOT MATCHED THEN
      INSERT    (slea_year,empid,bda_sum_sort,bda_dtl_sort,act_exp_lst_yr,fa_proj_exp_amt)
      VALUES ( '2008','6468T','30','9999','0','55');

    A merge statement is just a much more efficient way of doing something like this pl/sql block
    DECLARE
       l_n NUMBER;
    BEGIN
       FOR r IN (SELECT pk, col1, col2 FROM source) LOOP
          BEGIN
             SELECT 1 INTO l_n
             FROM target
             WHERE pk = r.pk;
             UPDATE target
             SET col1 = r.col1,
                 col2 = r.col2
             WHERE pk = r.pk;
          EXCEPTION WHEN NO_DATA_FOUND THEN
             INSERT INTO target
             VALUES(r.pk, r.col1, r.col2);
          END;
       END LOOP;
    END;So, if the select from source returns no rows, nothing is going to happen.
    John

  • Why won`t this complie?

    I get "Main.java": Error #: 202 : 'class' or 'interface' expected at line 49, column 8.For the setupLoginPanel().
    I get "Main.java": Error #: 202 : 'class' or 'interface' expected at line 158, column 18.For the login().
    This is for a Certificate project please help me correct these errors.
    Thanks!!
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.sql.*;
    import java.io.*;
    public class Main extends JFrame implements main_interface{
    final static String genexception = "GENERAL EXCEPTION";
    final static String driver      = "sun.jdbc.odbc.JdbcOdbcDriver";
    final static String url      = "jdbc:odbc:AddBKTAFE";
    final static String Login      = "LOG-IN";
    final static String tab_login      = "Log-in";
    final static String relogin      = "Log-in failed! Please relog-in!";
    final static String error      = "ERROR";
    JPanel panell;
    JTabbedPane tpane = new JTabbedPane();
    GridBagConstraints constraints = new GridBagConstraints();
    GridBagLayout layout = new GridBagLayout ();
    Font labelFont = new Font("Arial",Font.PLAIN,12);
    Font buttonFont = new Font("Arial",Font.BOLD,13);
    JButton btLogin      = new JButton (Login );
    JPasswordField jpPassword           = new JPasswordField(10 );
    JTextField tfUser           = new JTextField("",10 );
    JLabel lbUser           = new JLabel("Enter User ID: " );
    JLabel lbPassword           = new JLabel("Enter Password: ");
    Main app;
    // public Login log = new Login();
    JTextField tfUser;
    public Main(){
    System.out.println("loading.......please wait.");
    app.setSize(900,385);
    setupLoginPanel();
    app.setVisible(true);
    app.tfUser.requestFocus();
    app.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    //--------------------Start main------------------------------------------------>>>
         public static void main(String args[]){
              Main app = new Main();
    //--------------------End main-------------------------------------------------->>>
    public void setupLoginPanel(){
    // set application title
    setTitle("Address Book");
    // center screen
    setLocation((Toolkit.getDefaultToolkit().getScreenSize().width
    - getWidth())/2,
    (Toolkit.getDefaultToolkit().getScreenSize().height
    - getHeight())/2);
    String sql = ""; // Used to store sql statements
    Container cntr = getContentPane();
    JPanel panel1 = new JPanel();
    // set screen border
    panel1.setBorder(BorderFactory.createTitledBorder(
    BorderFactory.createEtchedBorder(),""));
    // add tabbedpane to panel
    tpane.addTab(tab_login, panel1);
    // add panel to container
    cntr.add(tpane);
    // setup layout as GridBagLayout
    constraints.insets = new Insets(2,2,2,2);
    panel1.setLayout(layout);
    // setup User ID label in display area
    lbUser.setFont(labelFont);
    constraints.ipadx = 2;
    constraints.ipady = 2;
    constraints.gridx = 0;
    constraints.gridy = 0;
    constraints.anchor = GridBagConstraints.WEST;
    layout.setConstraints(lbUser, constraints);
    panel1.add(lbUser);
    // setup User ID input field in display area
    tfUser.setFont(labelFont);
    constraints.ipadx = 2;
    constraints.ipady = 2;
    constraints.gridx = 1;
    constraints.gridy = 0;
    constraints.fill = GridBagConstraints.HORIZONTAL;
    layout.setConstraints(tfUser, constraints);
    panel1.add(tfUser);
    // setup Password label in display area
    lbPassword.setFont(labelFont);
    constraints.ipadx = 2;
    constraints.ipady = 2;
    constraints.gridx = 0;
    constraints.gridy = 1;
    constraints.anchor = GridBagConstraints.WEST;
    layout.setConstraints(lbPassword, constraints);
    panel1.add(lbPassword);
    // setup Password input field in display area
    jpPassword.setEchoChar('*');
    constraints.ipadx = 2;
    constraints.ipady = 2;
    constraints.gridx = 1;
    constraints.gridy = 1;
    layout.setConstraints(jpPassword, constraints);
    panel1.add(jpPassword);
    // setup Login button in display area
    btLogin.setFont(buttonFont);
    constraints.anchor = GridBagConstraints.WEST;
    constraints.gridy = 3;
    constraints.gridx = 1;
    layout.setConstraints(btLogin, constraints);
    panel1.add(btLogin);
    // setup login button listener
    btLogin.addActionListener(new ButtonHandler());
    // allow ALT L to press login button
    btLogin.setMnemonic('l');
    //--------------------End setupLoginPanel()------------------------------------->>
    //--------------------Start ButtonHandler--------------------------------------->>>
    // Action listener for the buttons on each screen
    class ButtonHandler implements ActionListener{
    public void actionPerformed(ActionEvent e){
    // get the label of the button
    String action = e.getActionCommand();
    if (action!=null){
    if(action==Login){
    // call method accessDB()
    login();
    // if login error, set cursor to user name input field
    tfUser.requestFocus();
    //--------------------End ButtonHandler----------------------------------------->>>
    //--------------------Start login()--------------------------------------------->>>
    // Validate user input from the login screen based on information from login
    // table (note: manually create/update your login from table LOGIN).
    public void login(){
    String user = tfUser.getText();
    user = user.trim();
    String password = jpPassword.getText();
    String sql = "SELECT * FROM persons WHERE username='"+
    user+"' AND password='"+password+"'";
    try{
    // load MS Access driver
    Class.forName(driver);
    }catch(java.lang.ClassNotFoundException ex){
    JOptionPane.showMessageDialog(null,ex.getMessage(), error ,
    JOptionPane.PLAIN_MESSAGE);
    try{
    // setup connection to DBMS
    Connection conn = DriverManager.getConnection(url);
    // create statement
    Statement stmt = conn.createStatement();
    // execute sql statement
    stmt.execute(sql);
    ResultSet rs = stmt.getResultSet();
    boolean recordfound = rs.next();
    if (recordfound){
    System.out.println("Login succeeded!");
    /*     tpane.removeTabAt(0);
    initComboBoxes();
    showPane1();
    showPane2();
    showPane3();
    else{
    // username/password invalid
    JOptionPane.showMessageDialog(null,relogin, error,
    JOptionPane.INFORMATION_MESSAGE);
    //clear login and password fields
    tfUser.setText ("");
    jpPassword.setText("");
    conn.close();
    }catch(Exception ex){
    JOptionPane.showMessageDialog(null,ex.getMessage(), genexception,
    JOptionPane.INFORMATION_MESSAGE);
    //--------------------End login()----------------------------------------------->>>

    you had a wrong } at line 47
    now it should work :
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.sql.*;
    import java.io.*;
    public class Main
    extends JFrame
    implements main_interface {
    final static String genexception = "GENERAL EXCEPTION";
    final static String driver = "sun.jdbc.odbc.JdbcOdbcDriver";
    final static String url = "jdbc:odbc:AddBKTAFE";
    final static String Login = "LOG-IN";
    final static String tab_login = "Log-in";
    final static String relogin = "Log-in failed! Please relog-in!";
    final static String error = "ERROR";
    JPanel panell;
    JTabbedPane tpane = new JTabbedPane();
    GridBagConstraints constraints = new GridBagConstraints();
    GridBagLayout layout = new GridBagLayout();
    Font labelFont = new Font("Arial", Font.PLAIN, 12);
    Font buttonFont = new Font("Arial", Font.BOLD, 13);
    JButton btLogin = new JButton(Login);
    JPasswordField jpPassword = new JPasswordField(10);
    JTextField tfUser = new JTextField("", 10);
    JLabel lbUser = new JLabel("Enter User ID: ");
    JLabel lbPassword = new JLabel("Enter Password: ");
    Main app;
    // public Login log = new Login();
    JTextField tfUser;
    public Main() {
    System.out.println("loading.......please wait.");
    app.setSize(900, 385);
    setupLoginPanel();
    app.setVisible(true);
    app.tfUser.requestFocus();
    app.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    //--------------------Start main------------------------------------------------>>>
    public static void main(String args[]) {
    Main app = new Main();
    //--------------------End main-------------------------------------------------->>>
    public void setupLoginPanel() {
    // set application title
    setTitle("Address Book");
    // center screen
    setLocation( (Toolkit.getDefaultToolkit().getScreenSize().width
    - getWidth()) / 2,
    (Toolkit.getDefaultToolkit().getScreenSize().height
    - getHeight()) / 2);
    String sql = ""; // Used to store sql statements
    Container cntr = getContentPane();
    JPanel panel1 = new JPanel();
    // set screen border
    panel1.setBorder(BorderFactory.createTitledBorder(
    BorderFactory.createEtchedBorder(), ""));
    // add tabbedpane to panel
    tpane.addTab(tab_login, panel1);
    // add panel to container
    cntr.add(tpane);
    // setup layout as GridBagLayout
    constraints.insets = new Insets(2, 2, 2, 2);
    panel1.setLayout(layout);
    // setup User ID label in display area
    lbUser.setFont(labelFont);
    constraints.ipadx = 2;
    constraints.ipady = 2;
    constraints.gridx = 0;
    constraints.gridy = 0;
    constraints.anchor = GridBagConstraints.WEST;
    layout.setConstraints(lbUser, constraints);
    panel1.add(lbUser);
    // setup User ID input field in display area
    tfUser.setFont(labelFont);
    constraints.ipadx = 2;
    constraints.ipady = 2;
    constraints.gridx = 1;
    constraints.gridy = 0;
    constraints.fill = GridBagConstraints.HORIZONTAL;
    layout.setConstraints(tfUser, constraints);
    panel1.add(tfUser);
    // setup Password label in display area
    lbPassword.setFont(labelFont);
    constraints.ipadx = 2;
    constraints.ipady = 2;
    constraints.gridx = 0;
    constraints.gridy = 1;
    constraints.anchor = GridBagConstraints.WEST;
    layout.setConstraints(lbPassword, constraints);
    panel1.add(lbPassword);
    // setup Password input field in display area
    jpPassword.setEchoChar('*');
    constraints.ipadx = 2;
    constraints.ipady = 2;
    constraints.gridx = 1;
    constraints.gridy = 1;
    layout.setConstraints(jpPassword, constraints);
    panel1.add(jpPassword);
    // setup Login button in display area
    btLogin.setFont(buttonFont);
    constraints.anchor = GridBagConstraints.WEST;
    constraints.gridy = 3;
    constraints.gridx = 1;
    layout.setConstraints(btLogin, constraints);
    panel1.add(btLogin);
    // setup login button listener
    btLogin.addActionListener(new ButtonHandler());
    // allow ALT L to press login button
    btLogin.setMnemonic('l');
    //--------------------End setupLoginPanel()------------------------------------->>
    //--------------------Start ButtonHandler--------------------------------------->>>
    // Action listener for the buttons on each screen
    class ButtonHandler
    implements ActionListener {
    public void actionPerformed(ActionEvent e) {
    // get the label of the button
    String action = e.getActionCommand();
    if (action != null) {
    if (action == Login) {
    // call method accessDB()
    login();
    // if login error, set cursor to user name input field
    tfUser.requestFocus();
    //--------------------End ButtonHandler----------------------------------------->>>
    //--------------------Start login()--------------------------------------------->>>
    // Validate user input from the login screen based on information from login
    // table (note: manually create/update your login from table LOGIN).
    public void login() {
    String user = tfUser.getText();
    user = user.trim();
    String password = jpPassword.getText();
    String sql = "SELECT * FROM persons WHERE username='" +
    user + "' AND password='" + password + "'";
    try {
    // load MS Access driver
    Class.forName(driver);
    catch (java.lang.ClassNotFoundException ex) {
    JOptionPane.showMessageDialog(null, ex.getMessage(), error,
    JOptionPane.PLAIN_MESSAGE);
    try {
    // setup connection to DBMS
    Connection conn = DriverManager.getConnection(url);
    // create statement
    Statement stmt = conn.createStatement();
    // execute sql statement
    stmt.execute(sql);
    ResultSet rs = stmt.getResultSet();
    boolean recordfound = rs.next();
    if (recordfound) {
    System.out.println("Login succeeded!");
    /* tpane.removeTabAt(0);
    initComboBoxes();
    showPane1();
    showPane2();
    showPane3();
    else {
    // username/password invalid
    JOptionPane.showMessageDialog(null, relogin, error,
    JOptionPane.INFORMATION_MESSAGE);
    //clear login and password fields
    tfUser.setText("");
    jpPassword.setText("");
    conn.close();
    catch (Exception ex) {
    JOptionPane.showMessageDialog(null, ex.getMessage(), genexception,
    JOptionPane.INFORMATION_MESSAGE);
    //--------------------End login()----------------------------------------------->>>

  • Why won't this contact form work?

    Hi All,
    Ok so i decided to update the contact form of page below as i was using the out dated spry validation method. I inserted the new contact form using webassist dreamweaver extension but i am now having big problems with this page. I am now unable to even open the page, please use link below to see the page error and i have also pasted the code of this page.
    http://www.milesfunerals.com/contact.php
    <?php virtual("/webassist/form_validations/wavt_scripts_php.php"); ?>
    <?php virtual("/webassist/form_validations/wavt_validatedform_php.php"); ?>
    <!DOCTYPE HTML>
    <html>
    <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Miles &amp; Daughters | Contact us by email or phone</title>
    <meta name="description" content="Contact us and speak to any of our friendly staff if you have any enquiries or if you would prefer you can contact us by email. You can also see pictures of all five of our branches. ">
    <meta name="keywords" content="contact, questions, enquiries, friendly, email, addresses, write, funeral home, branches, reading, wokingham, crowthorne, twyford, bracknell">
    <!--[if lt IE 9]>
    <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <link href="/stylesheet.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" href="fancyBox/source/jquery.fancybox.css?v=2.1.5" type="text/css" media="screen" />
    <script src="http://code.jquery.com/jquery-latest.min.js"></script>
    <script type="text/javascript" src="fancyBox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
    <script type="text/javascript">
    $(document).ready(function() {
    $('.fancybox').fancybox();
    </script>
    <style type="text/css">
    #sprytextfield2{
               form input[type=text] {width: 75%}
    textarea {width: 85%}
    #sprytextfield1{
               form input[type=text] {width: 75%}
    textarea {width: 85%}
    </style>
    <LINK REL="SHORTCUT ICON" HREF="http://www.milesmemorials.com/favicon.ico">
    <script src="/webassist/progress_bar/jquery-blockui-formprocessing.js" type="text/javascript"></script>
    <link href="/SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css">
    <script src="/SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
    <script src="/webassist/forms/wa_servervalidation.js" type="text/javascript"></script>
    <link href="/webassist/forms/fd_basic_default.css" rel="stylesheet" type="text/css">
    </head>
    <body>
    <div id="container">
    <?php include('includes/header.php'); ?>
    <?php include('includes/navbar2.php'); ?>
    <?php include('includes/navbar.php'); ?>
    <?php include('includes/sidebar.php'); ?>
    <div id="maindiv" class="maindiv_scroll">
      <p> </p>
      <p> </p>
        <p class="subheading">Miles and Daughters - Contact us</p>
      <p class="sub2">Addresses and telephone numbers for our offices are:</p>
    <p class="maintext"> </p>
    <p class="wokingham"><span class="address"><a class="fancybox" href="images/Isabella house.jpg" title="Miles & Daughters Winnersh Premises"><img src="images/Isabella house.jpg" alt="Miles &amp; Daughters Wokingham premisesh" width="297" height="263" class="shop"/></a></span> </p>
    <p class="wokingham"> </p>
    <p class="wokingham">Wokingham</p>
    <p class="address">Isabella House  </p>
    <p class="address">498a Reading Road</p>
      <p class="address"> Winnersh </p>
      <p class="address">Berkshire</p>
      <p class="address"> RG41 5EX</p>
      <p class="address"> Telephone: 0118 979 3004</p>
      <p class="address"> </p>
      <p class="address"> </p>
      <p class="address"> </p>
      <p class="address"> </p>
      <p class="address"> </p>
      <p class="address"> </p>
      <p class="address"><a class="fancybox" href="images/cav-1.jpg" title="Miles & Daughters Reading Premises"><img src="/images/cav-1.jpg" alt="Miles &amp; Daughters Reading premises" width="380" height="321" class="shop"/></a></p>
      <p class="address"> </p>
      <p class="address"> </p>
      <p class="address"> </p>
      <p class="wokingham">Reading</p>
    <p class="address">Tamela House</p>
      <p class="address">157-161 Caversham Road</p>
      <p class="address">Reading</p>
      <p class="address">Berkshire</p>
      <p class="address">RG1 8BB</p>
      <p class="address">Telephone: 0118 959 0022</p>
      <p class="address"> </p>
      <p class="address"> </p>
      <p class="address"> </p>
      <p class="address"> </p>
      <p class="address"><a class="fancybox" href="images/Ivydene2.jpg" title="Miles & Daughters Binfield Premises"><img src="images/Ivydene2.jpg" alt="Miles &amp; Daughters Bracknell premises" width="380" height="267" class="shop"/></a></p>
      <p class="wokingham"> </p>
      <p class="wokingham"> </p>
      <p class="wokingham"> </p>
      <p class="wokingham"> </p>
      <p class="wokingham">Bracknell</p>
      <p class="address">Ivydene House</p>
      <p class="address">Forest Road</p>
      <p class="address">Binfield</p>
      <p class="address">Bracknell</p>
      <p class="address">RG42 4HP</p>
      <p class="address">Telephone: 01344 452020  </p>
      <p class="wokingham"><span class="address"><a class="fancybox" href="images/twford.jpg" title="Miles & Daughters Twyford Premises"><img src="images/twford.jpg" alt="Miles &amp; Daughters Twyford premises" width="263" height="317" class="shop"/></a></span></p>
      <p class="wokingham"> </p>
      <p class="wokingham"> </p>
      <p class="wokingham"> </p>
      <p class="wokingham"> </p>
      <p class="wokingham"> </p>
      <p class="wokingham"> </p>
      <p class="wokingham">Twyford</p>
    <p class="address">The Old Clock House</p>
      <p class="address">Station Road</p>
      <p class="address"> Twyford</p>
      <p class="address">Berkshire </p>
      <p class="address">RG10 9NS</p>
      <p class="address"> Telephone: 0118 934 5474</p>
      <p class="address"> </p>
      <p class="address"> </p>
      <p class="address"> </p>
      <p class="address"><a class="fancybox" href="images/crowthorne.jpg" title="Miles & Daughters Crowthorne Premises"><img src="images/crowthorne.jpg" alt="Miles &amp; Daughters Crowthorne premises" width="362" height="239" class="shop"/></a></p>
      <p class="wokingham"> </p>
      <p class="wokingham"> </p>
        <p class="wokingham">Crowthorne</p>
    <p class="address">Alicya House</p>
      <p class="address">105 High Street</p>
      <p class="address"> Crowthorne</p>
      <p class="address">Berkshire </p>
      <p class="address">RG45 7AD</p>
      <p class="address"> Telephone: 01344 774932</p>
      <p class="address"> </p>
      <p class="address"> </p>
      <p class="address"> </p>
      <p class="endtext"> </p>
      <p class="endtext"> </p>
      <p class="maintext">You may email us or alternatively use the form below to contact us, one of our members of staff will respond as soon as possible.  </p>
      <p> </p>
      <div id="SimpleContact_Basic_Default_ProgressWrapper">
        <form class="Basic_Default" id="SimpleContact_Basic_Default" name="SimpleContact_Basic_Default" method="post" action="form-to-email.php">
          <!--
    WebAssist CSS Form Builder - Form v1
    CC: Contact
    CP: Simple Contact
    TC: Basic
    TP: Default
    -->
          <ul class="Basic_Default">
            <li>
              <fieldset class="Basic_Default" id="Contact_me">
                <legend class="groupHeader">Contact</legend>
                <ul class="formList">
                  <li class="formItem"> <span class="fieldsetDescription"> Required * </span> </li>
                  <li class="formItem">
                    <div class="formGroup">
                      <div class="lineGroup">
                        <div class="fullColumnGroup">
                          <label for="Full_Name" class="sublabel" > Name:<span class="requiredIndicator"> *</span></label>
                          <div class="errorGroup">
                            <div class="fieldPair">
                              <div class="fieldGroup"> <span id="Full_Name_Spry"> <span>
                                <input id="Full_Name" name="Full_Name" type="text" value="<?php echo((isset($_GET["invalid"])?ValidatedField("formtoemail","Full_Name"):"")); ?>" class="formTextfield_Large" tabindex="1" onBlur="hideServerError('Full_Name_ServerError');">
                                <span class="textfieldRequiredMsg">Please enter your name</span> </span> </span>
                                <?php
    if (ValidatedField('formtoemail','formtoemail'))  {
      if ((strpos((",".ValidatedField("formtoemail","formtoemail").","), "," . "1" . ",") !== false || "1" == ""))  {
        if (!(false))  {
    ?>
                                  <span class="serverInvalidState" id="Full_Name_ServerError">Please enter your name</span>
                                  <?php //WAFV_Conditional form-to-email.php formtoemail(1:)
    }?>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                      <div class="lineGroup">
                        <div class="fullColumnGroup">
                          <label for="Email_Address" class="sublabel" > Email:<span class="requiredIndicator"> *</span></label>
                          <div class="errorGroup">
                            <div class="fieldPair">
                              <div class="fieldGroup"> <span id="Email_Address_Spry"> <span>
                                <input id="Email_Address" name="Email_Address" type="text" value="<?php echo((isset($_GET["invalid"])?ValidatedField("formtoemail","Email_Address"):"")); ?>" class="formTextfield_Large" tabindex="2" onBlur="hideServerError('Email_Address_ServerError');">
                                <span class="textfieldInvalidFormatMsg">Invalid format.</span><span class="textfieldRequiredMsg">Please enter a full email address</span> </span> </span>
                                <?php
    if (ValidatedField('formtoemail','formtoemail'))  {
      if ((strpos((",".ValidatedField("formtoemail","formtoemail").","), "," . "2" . ",") !== false || "2" == ""))  {
        if (!(false))  {
    ?>
                                  <span class="serverInvalidState" id="Email_Address_ServerError">Please enter a full email address</span>
                                  <?php //WAFV_Conditional form-to-email.php formtoemail(2:)
    }?>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                      <div class="lineGroup">
                        <div class="fullColumnGroup">
                          <label for="Comments" class="sublabel" > Comments:</label>
                          <div class="errorGroup">
                            <div class="fieldPair">
                              <div class="fieldGroup"> <span>
                                <textarea name="Comments" id="Comments" class="formTextarea_Medium" rows="1" cols="1" tabindex="3"><?php echo((isset($_GET["invalid"])?ValidatedField("formtoemail","Comments"):"")); ?></textarea>
                              </span> </div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </li>
                  <li class="formItem">
                    <div class="formGroup">
                      <div class="lineGroup">
                        <div class="fullColumnGroup">
                          <div class="fullColumnGroup">
                            <label for="Security_Code" class="sublabel" > </label>
                            <div class="errorGroup">
                              <div class="fieldPair">
                                <div class="fieldGroup"> <span> <img src="/webassist/captcha/wavt_captchasecurityimages.php?field=Security_Code&amp;noisefreq= 15&amp;noisecolor=060606&amp;gridcolor=080808&amp;font=fonts/MOM_T___.TTF&amp;textcolor=04 0404" alt="Security Code" class="Captcha"> </span> </div>
                              </div>
                            </div>
                          </div>
                          <div class="fullColumnGroup" style="clear:left;">
                            <label for="Security_Code" class="sublabel" > Security code:<span class="requiredIndicator"> *</span></label>
                            <div class="errorGroup">
                              <div class="fieldPair">
                                <div class="fieldGroup"> <span id="Security_Code_Spry"> <span>
                                  <input id="Security_Code" name="Security_Code" type="text" value="" class="formTextfield_Large" tabindex="4" onBlur="hideServerError('Security_Code_ServerError');">
                                  <span class="textfieldRequiredMsg">Entered text does not match; please try again</span> </span> </span>
                                  <?php
    if (ValidatedField('formtoemail','formtoemail'))  {
      if ((strpos((",".ValidatedField("formtoemail","formtoemail").","), "," . "3" . ",") !== false || "3" == ""))  {
        if (!(false))  {
    ?>
                                    <span class="serverInvalidState" id="Security_Code_ServerError">Entered text does not match; please try again</span>
                                    <?php //WAFV_Conditional form-to-email.php formtoemail(3:)
    }?>
                                </div>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                      <div class="lineGroup">
                        <div class="fullColumnGroup">
                          <div class="fullColumnGroup">
                            <label for="Security_Answer_2" class="sublabel" > </label>
                            <div class="errorGroup">
                              <div class="fieldPair">
                                <div class="fieldGroup"> <span> <span class="precedingText">
                                  <?php virtual("/webassist/captcha/wavt_captchasecurityquestion.php"); ?>
                                </span> </span> </div>
                              </div>
                            </div>
                          </div>
                          <div class="fullColumnGroup" style="clear:left;">
                            <label for="Security_Answer" class="sublabel" > Answer:<span class="requiredIndicator"> *</span></label>
                            <div class="errorGroup">
                              <div class="fieldPair">
                                <div class="fieldGroup"> <span id="Security_Answer_Spry"> <span>
                                  <input id="Security_Answer" name="Security_Answer" type="text" value="" class="formTextfield_Large" tabindex="5" onBlur="hideServerError('Security_Answer_ServerError');">
                                  <span class="textfieldRequiredMsg">Incorrect
                                    response; please try again</span> </span> </span>
                                  <?php
    if (ValidatedField('formtoemail','formtoemail'))  {
      if ((strpos((",".ValidatedField("formtoemail","formtoemail").","), "," . "4" . ",") !== false || "4" == ""))  {
        if (!(false))  {
    ?>
                                    <span class="serverInvalidState" id="Security_Answer_ServerError">Incorrect
                                      response; please try again</span>
                                    <?php //WAFV_Conditional form-to-email.php formtoemail(4:)
    }?>
                                </div>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </li>
                  <li class="formItem"> <span class="buttonFieldGroup" >
                    <input id="Hidden_Field" name="Hidden_Field" type="hidden" value="<?php echo((isset($_GET["invalid"])?ValidatedField("formtoemail","Hidden_Field"):"")); ?>">
                    <input class="formButton" name="SimpleContact_submit" type="submit" id="SimpleContact_submit" value="Contact me"  onClick="clearAllServerErrors('SimpleContact_Basic_Default')">
                  </span> </li>
                </ul>
              </fieldset>
            </li>
          </ul>
        </form>
      </div>
      <div id="SimpleContact_Basic_Default_ProgressMessageWrapper" class="blockUIOverlay" style="display:none;">
        <script type="text/javascript">
    WADFP_SetProgressToForm('SimpleContact_Basic_Default', 'SimpleContact_Basic_Default_ProgressMessageWrapper', WADFP_Theme_Options['BigSpin:Slate']);
        </script>
        <div id="SimpleContact_Basic_Default_ProgressMessage" >
          <p style="margin:10px; padding:5px;" ><img src="/webassist/progress_bar/images/slate-largespin.gif" alt="" title="" style="vertical-align:middle;" />  Please wait</p>
        </div>
      </div>
      <p class="maintext"> </p>
    </div>
    <?php include('includes/footer.php'); ?>
    </div>
    <script type="text/javascript">
    var Full_Name_Spry = new Spry.Widget.ValidationTextField("Full_Name_Spry", "none",{validateOn:["blur"]});
    var Email_Address_Spry = new Spry.Widget.ValidationTextField("Email_Address_Spry", "email",{validateOn:["blur"]});
    var Security_Code_Spry = new Spry.Widget.ValidationTextField("Security_Code_Spry", "none",{validateOn:["blur"]});
    var Security_Answer_Spry = new Spry.Widget.ValidationTextField("Security_Answer_Spry", "none",{validateOn:["blur"]});</script>
    </body>
    </html>

    Might want to have a look at this form below. It's similar to yours but no styling - you'd need to use some css to style it up a bit. It's just the raw html/php coding. The form action="form_send.php" - basically save the code to a Dreamweaver document named form_send.php and send the information back to the page to be processed.
    <?php
    $number_1 = rand(1, 9);
    $number_2 = rand(1, 9);
    $answer = md5($number_1+$number_2);
    if(isset($_POST['submit'])) {
    // get the name from the form 'name' field
    $name = trim($_POST['name']);
    if (empty($name)) {
    $error['name'] = "<span>Please provide your name</span>";
    // get the email from the form 'email' field
    $email = trim($_POST['email']);
    if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
    $error['email'] = "<span>Please provide a valid email address</span>";
    // get the comments from the form 'comments' field 
    $comments = trim($_POST['comments']);   
    if (empty($comments)) {
    $error['comments'] = "<span>Please provide your comments</span>";
    // security against spam   
    $user_answer = trim(htmlspecialchars($_POST['user_answer']));
    $answer = trim(htmlspecialchars($_POST['answer']));
    if (md5($user_answer) != $answer) {
        $error['answer'] = "<span>Wrong answer - please try again</span>";
    // if no errors send the form   
    if (!isset($error) && md5($user_answer) == $answer) {
    $to = '[email protected]'; // send to recipient
    $from = '[email protected]'; // from your domain
    $subject = 'Response from website';
    $message = "From: $name\r\n\r\n";
    $message .= "Email: $email\r\n\r\n";
    $message .= "Comments: $comments";
    $headers = "From: $from\r\nReply-to: $email";
    $sent = mail($to, $subject, $message, $headers);
    echo 'Your message has been sent.';
    else {
    $number_1 = rand(1, 9);
    $number_2 = rand(1, 9);
    $answer = md5($number_1+$number_2);
    ?>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Untitled Document</title>
    <style>
    #contactForm span {
        color: #900;
    </style>
    </head>
    <body>
    <form name="contactForm" id="contactForm" method="post" action="form_send.php">
    <p><label for="name">Name<input type="text" name="name" id="name" value="<?php if(isset($name)) {echo $name; } ?>" <?php if(isset($error['name'])) {echo 'style="background-color: #FCC;"'; } ?>></label><br>
    <?php if(isset($error['name'])) {echo $error['name']; } ?></p>
    <p><label for="email">Email<input type="text" name="email" id="email" value="<?php if(isset($email)) {echo $email; } ?>" <?php if(isset($error['email'])) {echo 'style="background-color: #FCC;"'; } ?>></label><br>
    <?php if(isset($error['email'])) {echo $error['email']; } ?></p>
    <p><label for="comments">Comments<textarea name="comments" id="comments" <?php if(isset($error['comments'])) {echo 'style="background-color: #FCC;"'; } ?>>
    <?php if(isset($comments)) { echo $comments; } ?></textarea></label><br>
    <?php if(isset($error['comments'])) {echo $error['comments']; } ?></p>
    <p>Spam prevention - please answer the question below:</p>
    <p><?php echo $number_1; ?> + <?php echo $number_2; ?> = ?<input type="text" name="user_answer" <?php if(isset($error['answer'])) {echo 'style="background-color: #FCC;"'; } ?>/>
    <input type="hidden" name="answer" value="<?php echo $answer; ?>" /><br>
    <?php if(isset($error['answer'])) {echo $error['answer']; } ?></p>
    <p><input type="submit" name="submit" id="sumbit"></p>
    </form>
    </body>
    </html>

  • Why won't this source code compile?

    I have been writing a simple app for a simple form. I have been using a gridbaglayout and checked compilation almost every step of the way, but then right as i am getting towards the end and have to start putting in the actioneventlisteners etc. ......... My code doesn't compile.
    Here is the source code:
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    public class LearnerLookup extends JFrame implements ActionListener {
    void buildConstraints(GridBagConstraints gbc, int gx, int gy,
    int gw, int gh, int wx, int wy) {
    gbc.gridx = gx;
    gbc.gridy = gy;
    gbc.gridwidth = gw;
    gbc.gridheight = gh;
    gbc.weightx = wx;
    gbc.weighty = wy;
    /** Creates a new instance of LearnerLookup */
    public LearnerLookup() {       
    super("Learner Lookup");
    setBounds(225, 250, 300, 180);
    GridBagLayout gridbag = new GridBagLayout();
    GridBagConstraints constraints = new GridBagConstraints();
    JPanel pane = new JPanel();
    pane.setLayout(gridbag);
    // Last Name Label
    buildConstraints(constraints, 0, 0, 1, 1, 25, 25);
    constraints.fill = GridBagConstraints.NONE;
    constraints.anchor = GridBagConstraints.EAST;
    JLabel lastNameLabel = new JLabel("Last Name:", JLabel.LEFT);
    gridbag.setConstraints(lastNameLabel, constraints);
    pane.add(lastNameLabel);
    // Last Name Field
    buildConstraints(constraints, 1, 0, 1, 1, 75, 0);
    constraints.fill = GridBagConstraints.HORIZONTAL;
    JTextField lastNameField = new JTextField(20);
    gridbag.setConstraints(lastNameField, constraints);
    pane.add(lastNameField);
    // First Name Label
    buildConstraints(constraints, 0, 1, 1, 1, 0, 25);
    constraints.fill = GridBagConstraints.NONE;
    constraints.anchor = GridBagConstraints.EAST;
    JLabel firstNameLabel = new JLabel("First Name:", JLabel.LEFT);
    gridbag.setConstraints(firstNameLabel, constraints);
    pane.add(firstNameLabel);
    //First Name Field
    buildConstraints(constraints, 1, 1, 1, 1, 0, 0);
    constraints.fill = GridBagConstraints.HORIZONTAL;
    JTextField firstNameField = new JTextField(20);
    gridbag.setConstraints(firstNameField, constraints);
    pane.add(firstNameField);
    // Admission Number Label
    buildConstraints(constraints, 0, 2, 1, 1, 0, 25);
    constraints.fill = GridBagConstraints.NONE;
    constraints.anchor = GridBagConstraints.EAST;
    JLabel admNumLabel = new JLabel("Admission Number:", JLabel.LEFT);
    gridbag.setConstraints(admNumLabel, constraints);
    pane.add(admNumLabel);
    // Admission Number Field
    buildConstraints(constraints, 1, 2, 1, 1, 0, 0);
    constraints.fill = GridBagConstraints.HORIZONTAL;
    JTextField admNumField = new JTextField(10);
    gridbag.setConstraints(admNumField, constraints);
    pane.add(admNumField);
    // Enter Button
    buildConstraints(constraints, 0, 3, 1, 1, 0, 15);
    constraints.fill = GridBagConstraints.HORIZONTAL;
    constraints.anchor = GridBagConstraints.SOUTHWEST;
    JButton enterButton = new JButton("Enter");
    gridbag.setConstraints(enterButton, constraints);
    pane.add(enterButton);
    // Clear Button
    buildConstraints(constraints, 1, 3, 1, 1, 0, 0);
    constraints.fill = GridBagConstraints.HORIZONTAL;
    constraints.anchor = GridBagConstraints.SOUTHEAST;
    JButton clearButton = new JButton("Clear");
    gridbag.setConstraints(clearButton, constraints);
    pane.add(clearButton);
    //Content Pane
    setContentPane(pane);
    public static void main(String[] arguments) {
    LearnerLookup lookup = new LearnerLookup();
    ExitWindow exit = new ExitWindow();
    lookup.addWindowListener(exit);
    lookup.show();
    public void actionPerformed(ActionEvent evt) {
    Object source = evt.getSource();
    if (source == enterButton);
    The error message that I get is the following:
    LearnerLookup.java [101:1] cannot resolve symbol
    symbol : variable enterButton
    location: class LearnerLookup
    if (source == enterButton);
    ^
    1 error
    Errors compiling LearnerLookup.
    I'd be glad for some enlightenment on this one.
    Thanks

    enterButton is declared inside the constructor and so is not accessible from actionPerformed.
    Declare enterButton as an instance variable and remove the declaration from the constructor.
    e.g.public class LearnerLookup extends JFrame implements ActionListener {
          JButton enterButton;and in constructor:
    // JButton enterButton = new JButton("Enter");    Remove this line
    enterButton = new JButton("Enter");                   // replace with this. You'll probably need to do this for all the components with actionPerformed methods.

Maybe you are looking for

  • Restriction on number of line items in an automatically generated document

    Hi all, As per my info, an accounting document must have a minimum of 2 line items to complete the document. At the same time an accounting document can have a maximum of 999 line items. My observation:- When I am posting depreciation using t-code AF

  • Is it possible to run all Dos based command on Java ?

    hello friends I run Dos Commands on Java by following code try{ Process p=Runtime.getRuntime().exec(new String[]{"cmd.exe","/c","dir"}); }catch(Exception e){e.printStackTrace();} System.out.println("bye"); If I run "mkdir" instead of "dir" folder is

  • End of Useful life for an asset

    Hello, Does anyone know if there is any standard report which states when the asset's useful life is going to end? Even if there is no standard report, does anyone know if this information is stored in any tables from which it can be extracted. Basic

  • Reverse 3:2 Pulldown to convert AVCHD PF24 to 24P proper?

    Hi Everyone, Does anyone know if Final Cut Pro X has the ability to natively convert video shot in PF24 and convert it to a true 24 frames per second? Proper de-interlacing is a must. I have a Canon HF20 and I love it except for the fact that it does

  • Retrieve Business Area.....

    Hi, There is a login id TEST123 in the development environment with admin access and the business area TEST is used to create discoverer reports and the version is 10.1.2.1 By mistake the other developer went to the menu, Tools --> Security --> Selec