This code cannot possibly fail. Why is it failing?

LV 2010 (yes, 2010), Win Vista.
I have a DISPLAY UPDATE event, occurring at 2 Hz.
The event carries an array of values, one for each channel.
Four CHANNEL SELECTORS drive an ARRAY INDEX operation.
The four selected channels are shown separately on numeric indicators, then combined on to a waveform chart.
The little subVIs are there to produce a NaN for charting if the channel selector is -1 (none).
Currently they are changed to output a "123.0" value, for debugging purposes.
The HELP says that the ARRAY INDEX will produce a default 0 if the input index is outside the bounds of the array.
Yet, under certain circumstances (see JING at http://screencast.com/t/0kO0GDhlo0E), the "CHART VALUE" indicators fail to update.
In that video, I set the indicators to values of 1, 2, 3, 4 before starting the program.
I DO NOT set the DEFAULT, just enter those numbers into the panel indicators.
The two which have selected channels are updated seemingly normally.  The other two, which are left at NONE (-1) do not update.
I would expect them to show a zero, or SOMETHING, but the "3" and "4" never change.
This code is called, as evidenced by the chart advancing, but the values do not change.
If I change the channel to a live channel, then back to NONE, it will return to 0.  That's expected.
But why doesn't it update at first?
If I swap the channel selectors around, the problem swaps with it. Any selector set on NONE has the corresponding indicator unchanged from the starting value.
ABOUT THE CODE:
This is a REENTRANT VI,  inserted into a SUBPANEL.
Here's the insertion code:
The idea is that each control on the page is a subpanel, each will receive an instance of this one VI.
For each subpanel, I open a new re-entrant ref to this VI (it's set to be reentrant), and insert that ref into the subpanel.
I set a couple of control values, and start it running.
KEY FACTS:
1... If I change OPTIONS = 8 to OPTIONS = 0 in the above, the problem goes away. Everything works as expected.
2... The N=1 in the above, is simply to limit the number of instances, for debugging purposes.
3... I get no errors at any time.
4... I've tried with and without a wire to the TYPE SPECIFIER VI REFNUM input of OPEN VI REFERENCE.  No change.
A search on this topic brings up some 2008 issues with LV 8.0, and a suggestion there to use a VIT as the item inserted had no effect here.
So, why does the indicator NOT update if the index is -1, at first?  It's as if the code is not there.
And why does making it non-reentrant fix it?
(I have to have it reentrant so I can have multiple instances).
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com
Blog for (mostly LabVIEW) programmers: Tips And Tricks
Solved!
Go to Solution.

I don't know how to probe that in the real situation.
If I put a probe there, it doesn't tell me anything, because it's a re-entrant copy that's actually running: the probe is on the original VI which isn't.
If I make it non-reentrant, the problem goes away.
KEY FACTS:
8... Moving the indicators OFF the tab page does nothing different.
9... another page of the inner tab has more text indicators (20) instead of a chart. (see pic below).  That page shows the same behavior.  Any selector inditialized to -1 fails to update until it is first set to an active channel.
10... It doesn't matter if the selector values are converted to I32 or not (not that I would expect it to).
11.. The selectors are given a STRINGS & VALUES property of ["< None >", -1] by the init code, or ["Speed", 2} or ["Torque", 3] or something if the channel is found in the settings file.  When you click on it, I populated the menu with all channels and all indexes.  Wonder if there's something wonky with that.
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com
Blog for (mostly LabVIEW) programmers: Tips And Tricks

Similar Messages

  • What is wrong in this code..please

    first of all,i kindly request team please not kill me by giving suggestion using xml parser.......can u please tell how this handle in reading follwing lines....
    orderREF="1036578"><edm:OrderItem><edm:Order orderID="1036579"/> ineed to retoeve value 1036578 i use following code
    final String START6_TAG="orderREF=";
    final String END6_TAG=">";
    final String END7_TAG="/>";
    as per my observation,the follwing code need not work
    if(line.indexOf(START6_TAG)> -1 ) {
    //this code handle "orderREF=" in stands for order id
    if(line.indexOf(END7_TAG,line.indexOf(START6_TAG))>-1){ //because if we use line.indexOf(END7_TAG)it take only first indexof that..
    efound9=false;
    asper above line this code cannot excecute.but igo to loop and set flag efound9=false, what is wrong in this code for handling
    orderREF="1036578"/><edm:OrderItem><edm:Order orderID="1036579"/> this type of line that also comes in same program,here also we need output as 1036578.please tell me what i will do to hanndle these

    first of all,i kindly request team please not kill
    me by giving suggestion using xml parser.......can u
    please tell how this handle in reading follwing
    lines.... I don't understand why you are so opposed to an xml parser. You could have spent 3 hours learning how to use it and been done with this problem in the time you've spent trying to hack your way around it.
    jdom tutorials: http://www.jdom.org/downloads/docs.html
    dom4j tutorials: http://www.dom4j.org/cookbook.html

  • Can someone explain me this code?

    Hi... pls explain me this code if possible.
    try {
    wdContext.nodeStateList().bind( (Z_Hress_P0006_State_Input)model.createModelObject(Z_Hress_P0006_State_Input.class));
    wdContext.currentStateListElement().setI_Withemptyline(true);
    wdContext.currentStateListElement().setI_Countrykey(
                        wdContext.currentCountryRecordsElement().getLand());
                   wdContext.currentStateListElement().modelObject().execute();

    Pankak,
    wdDoInit is a method in Web Dynpro controllers that ie executed when controller code is executed first time (initialized) its never run again in the lifespan of that controller (view controller, component controller, custom controller).
    You can get some more introductory material about Web Dynpro here
    https://www.sdn.sap.com/irj/sdn/developerareas/webdynpro?rid=/webcontent/uuid/063bc942-0a01-0010-e7ae-d138e97acb5a [original link is broken]
    Also I would suggest you to buy the Inside Web Dynpro book.
    http://www.sappressbooks.com/product.cfm?account=&product=H983
    This book will help to make your web dynpro concepts solid. I am assuming you know java.
    Regarding the point, i don't have much idea how to give the points, I assume when you close the question you can assign the points.
    Regards,
    Anand

  • MC container causes this code to fail...why ?

    Hi
    Flash CS5 as3
    We have settlements named with suffix _Level2 such as e.g. Mitre'sGate_Level2 as well as _Level3 as MovieClips that are in a container MovieClip called Map_Collection.
    The code below fails with the error shown if the code line shown in bold is used, it works with:-
    var clipName :String = String(e.item[s]).replace(r,"")+currentLevel;             if the settlements are placed directly on stage.
    The code identifies _Level2 or Level3 at end of button name e.g. DistrictA_Level2 and appends it to the dataGrid output on the MouseHover.
    What should the code read to resolve this problem that we have poured heart and soul into for 2 hours ?
    Error is:-
    Map_Collection.Mitre'sGate_Level2
    TypeError: Error #1010: A term is undefined and has no properties.
    at BusMap_fla::MainTimeline/ShowSymbols()
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at fl.controls::SelectableList/handleCellRendererMouseEvent()
    at fl.controls::DataGrid/handleCellRendererMouseEvent()
    Code is:-
    dg.addEventListener(ListEvent.ITEM_ROLL_OVER,ShowSymbols);
    function ShowSymbols(e:ListEvent):void{
    makeAllVisibleF(false);
    var r:RegExp = /\W/g;
    for(var s:String in e.item){
    //trace(currentLevel)
    if(e.item[s]){
    var clipName :String = String(e.item[s]).replace(r,"")+currentLevel;
    trace(clipName)
    this[clipName].visible=true;
    trace(s,e.item[s])
    function makeAllVisibleF(b:Boolean):void{
    Mitre'sGate_Level2.visible=b;
    UpperDowning_Level2.visible=b
    //Map_Collection.Tamar Brook_Level3.visible=b;
    Map_Collection.Mitre'sGate_Level2.visible=b;
    This code works on sttmnts directly on stage.
    I show here an extract of the code visible=b; that follows it. we have such for every sttmnt. The first two lines are for those not in the MC container.
    if we use:-
    var clipName :String = "Map_Collection."+String(e.item[s]).replace(r,"")+currentLevel;
    which is our best stab after trying various options, it fails with error above.
    My compatriot says, in code !!!  
    // This is what we want
    Map_Collection.Mitre'sGate_Level2.visible=true
    //This doesn’t work
    Map_Collection.this[clipName].visible=true
    //This works, when Mitre'sGate_Level2 is placed on the stage
    Mitre'sGate_Level2.visible=true
    //Placing Mitre'sGate_Level2 in movie clip Map_Collection How do we get it to work
    We tried a variety of  options, even replacing 'this' with Map_Collection.., my best stab,  just what should the code be ?
    Envirographics

    Hi,
    Not sure of that, (also now have edited csv to no gaps or apostrphes, still it fails) ...because the code I posted is the code we are successfully running in a test file where there is a dataGrid fed a csv with such as Mitre's Gate Collet's Reach etc.  This code removes the  apostrophes and gaps when user hovers datagrid, MC's spelt MitresGate etc are identified and appear, then hide again when another row is hovered. Note also as said, Mitre's Gate outside of MC Map_Collection is found and shows.
    The code in this test file (which is 3 columns) is:-
    import flash.net.URLLoader;
    import flash.events.Event;
    import flash.net.URLRequest;
    import fl.data.DataProvider;
    import fl.controls.DataGrid;
    import fl.events.ListEvent
    makeAllVisibleF(false);
    var urlLoader:URLLoader = new URLLoader();
    urlLoader.addEventListener(Event.COMPLETE,completeF);
    urlLoader.load(new URLRequest("NamesWithNullCellsGapsApostrophes.csv"));
    var dg:DataGrid
    function completeF(e:Event):void{
        var dataS:String = e.target.data;
        var dataA:Array = dataS.split("\n").join("").split("\r");
        var dpA:Array = [];
        var itemA:Array;
    var r:RegExp = /\W/g;
        for(var i:int=0;i<dataA.length;i++){
            itemA = dataA[i].split(",");
             dpA.push({"col1":itemA[0],"col2":itemA[1],"col3":itemA[2]});
    var dp:DataProvider = new DataProvider(dpA);
        dg.columns = ["col1","col2","col3"]
        dg.dataProvider = dp;
    dg.addEventListener(ListEvent.ITEM_ROLL_OVER,ShowSymbols);
    function ShowSymbols(e:ListEvent):void{
    makeAllVisibleF(false);
    var r:RegExp = /\W/g;
    for(var s:String in e.item){
    if(e.item[s]){
    var clipName :String = String(e.item[s]).replace(r,"");
    this[clipName].visible=true;
    trace(s,e.item[s])
    function makeAllVisibleF(b:Boolean):void{
    We have introduced to that the code by Kglad, or so we hope, that appends to the output from OnHover  _Level2 or _Level3 depending on which District button is clicked on, DistrictA_Level2 or DistrictA_Level3.
    Just to recap/describe what we are aiming at, a map has 6 districts, user clicks District A button named in instance DistrictA_Level 2and is taken to that District, a dataGrid appears and when user hovers a row, the settlements for that layer of the map, e.g. Mitre's Gate_Layer2  appear. csv just has Mitre's Gate. user clicks on DistrictA_Level3 button and hover will show Mitre's Gate_L
     evel3 symbol. 
    Kglad code:-
    var currentLevel:String="_Level2";
    dg.addEventListener(ListEvent.ITEM_ROLL_OVER,ShowSymbols);
    function ShowSymbols(e:ListEvent):void{
    makeAllVisibleF(false);
    var r:RegExp = /\W/g;
    for(var s:String in e.item){
    if(e.item[s]){
    var clipName :String = String(e.item[s]).replace(r,"")+currentLevel;
    this[clipName].visible=true;
    trace(s,e.item[s])
    and when asked how one gets the Level2 into that var when user clicks on e.g. DistrictA_Level2
    we now have, for the 12 buttons we have named, reply from Kglad
     :-• DistrictA_Level2.addEventListener(MouseEvent.CLICK, clickF);
    DistrictB_Level2.addEventListener(MouseEvent.CLICK, clickF);
    DistrictF_Level2.addEventListener(MouseEvent.CLICK, clickF);
    DistrictA_Level3.addEventListener(MouseEvent.CLICK, clickF);
    DistrictB_Level3.addEventListener(MouseEvent.CLICK, clickF);
    DistrictF_Level3.addEventListener(MouseEvent.CLICK, clickF);
    var currentLevel:String;
    function clickF(e:MouseEvent):void{
    currentLevel="_"+e.currentTarnget.name.split("_")[1];
    for the moment we are focusing on getting it operational on just button DistrictA_Level2
    As said works fine if MC Mitre's Gate sits on stage, so the apostrophy and gap stripping is working as is the appending of the wording after and including the _ from the District button !  Place the settlement MC into Map_Collection MC and it fails.
    Envirographics

  • Why does this code fail in command line?

    I am using the "ListDemo" from the java swing tutorial. If I compile it on the command line
    javac ListDemo.java
    It compiles fine. Then when I run it, it says:
    C:\Development\Java\Projects\Projects>java ListDemo
    Exception occurred during event dispatching:
    java.lang.NoSuchMethodError
    at ListDemo.createAndShowGUI(ListDemo.java:196)
    at ListDemo.access$400(ListDemo.java:7)
    at ListDemo$1.run(ListDemo.java:217)
    at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
    Yet when I load up the same file into Netbeans, it compiles and runs fine! Here is the file:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    /* ListDemo.java is a 1.4 application that requires no other files. */
    public class ListDemo extends JPanel
                          implements ListSelectionListener {
        private JList list;
        private DefaultListModel listModel;
        private static final String hireString = "Hire";
        private static final String fireString = "Fire";
        private JButton fireButton;
        private JTextField employeeName;
        public ListDemo() {
            super(new BorderLayout());
            listModel = new DefaultListModel();
            listModel.addElement("Alan Sommerer");
            listModel.addElement("Alison Huml");
            listModel.addElement("Kathy Walrath");
            listModel.addElement("Lisa Friendly");
            listModel.addElement("Mary Campione");
            listModel.addElement("Sharon Zakhour");
            //Create the list and put it in a scroll pane.
            list = new JList(listModel);
            list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
            list.setSelectedIndex(0);
            list.addListSelectionListener(this);
            list.setVisibleRowCount(5);
            JScrollPane listScrollPane = new JScrollPane(list);
            JButton hireButton = new JButton(hireString);
            HireListener hireListener = new HireListener(hireButton);
            hireButton.setActionCommand(hireString);
            hireButton.addActionListener(hireListener);
            hireButton.setEnabled(false);
            fireButton = new JButton(fireString);
            fireButton.setActionCommand(fireString);
            fireButton.addActionListener(new FireListener());
            employeeName = new JTextField(10);
            employeeName.addActionListener(hireListener);
            employeeName.getDocument().addDocumentListener(hireListener);
            String name = listModel.getElementAt(
                                  list.getSelectedIndex()).toString();
            //Create a panel that uses BoxLayout.
            JPanel buttonPane = new JPanel();
            buttonPane.setLayout(new BoxLayout(buttonPane,
                                               BoxLayout.LINE_AXIS));
            buttonPane.add(fireButton);
            buttonPane.add(Box.createHorizontalStrut(5));
            buttonPane.add(new JSeparator(SwingConstants.VERTICAL));
            buttonPane.add(Box.createHorizontalStrut(5));
            buttonPane.add(employeeName);
            buttonPane.add(hireButton);
            buttonPane.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
            add(listScrollPane, BorderLayout.CENTER);
            add(buttonPane, BorderLayout.PAGE_END);
        class FireListener implements ActionListener {
            public void actionPerformed(ActionEvent e) {
                //This method can be called only if
                //there's a valid selection
                //so go ahead and remove whatever's selected.
                int index = list.getSelectedIndex();
                listModel.remove(index);
                int size = listModel.getSize();
                if (size == 0) { //Nobody's left, disable firing.
                    fireButton.setEnabled(false);
                } else { //Select an index.
                    if (index == listModel.getSize()) {
                        //removed item in last position
                        index--;
                    list.setSelectedIndex(index);
                    list.ensureIndexIsVisible(index);
        //This listener is shared by the text field and the hire button.
        class HireListener implements ActionListener, DocumentListener {
            private boolean alreadyEnabled = false;
            private JButton button;
            public HireListener(JButton button) {
                this.button = button;
            //Required by ActionListener.
            public void actionPerformed(ActionEvent e) {
                String name = employeeName.getText();
                //User didn't type in a unique name...
                if (name.equals("") || alreadyInList(name)) {
                    Toolkit.getDefaultToolkit().beep();
                    employeeName.requestFocusInWindow();
                    employeeName.selectAll();
                    return;
                int index = list.getSelectedIndex(); //get selected index
                if (index == -1) { //no selection, so insert at beginning
                    index = 0;
                } else {           //add after the selected item
                    index++;
                listModel.insertElementAt(employeeName.getText(), index);
                //If we just wanted to add to the end, we'd do this:
                //listModel.addElement(employeeName.getText());
                //Reset the text field.
                employeeName.requestFocusInWindow();
                employeeName.setText("");
                //Select the new item and make it visible.
                list.setSelectedIndex(index);
                list.ensureIndexIsVisible(index);
            //This method tests for string equality. You could certainly
            //get more sophisticated about the algorithm.  For example,
            //you might want to ignore white space and capitalization.
            protected boolean alreadyInList(String name) {
                return listModel.contains(name);
            //Required by DocumentListener.
            public void insertUpdate(DocumentEvent e) {
                enableButton();
            //Required by DocumentListener.
            public void removeUpdate(DocumentEvent e) {
                handleEmptyTextField(e);
            //Required by DocumentListener.
            public void changedUpdate(DocumentEvent e) {
                if (!handleEmptyTextField(e)) {
                    enableButton();
            private void enableButton() {
                if (!alreadyEnabled) {
                    button.setEnabled(true);
            private boolean handleEmptyTextField(DocumentEvent e) {
                if (e.getDocument().getLength() <= 0) {
                    button.setEnabled(false);
                    alreadyEnabled = false;
                    return true;
                return false;
        //This method is required by ListSelectionListener.
        public void valueChanged(ListSelectionEvent e) {
            if (e.getValueIsAdjusting() == false) {
                if (list.getSelectedIndex() == -1) {
                //No selection, disable fire button.
                    fireButton.setEnabled(false);
                } else {
                //Selection, enable the fire button.
                    fireButton.setEnabled(true);
         * Create the GUI and show it.  For thread safety,
         * this method should be invoked from the
         * event-dispatching thread.
        private static void createAndShowGUI() {
            //Make sure we have nice window decorations.
            JFrame.setDefaultLookAndFeelDecorated(true);
            //Create and set up the window.
            JFrame frame = new JFrame("ListDemo");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            //Create and set up the content pane.
            JComponent newContentPane = new ListDemo();
            newContentPane.setOpaque(true); //content panes must be opaque
            frame.setContentPane(newContentPane);
            //Display the window.
            frame.pack();
            frame.setVisible(true);
        public static void main(String[] args) {
            //Schedule a job for the event-dispatching thread:
            //creating and showing this application's GUI.
            javax.swing.SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    createAndShowGUI();

    You are not running this code under JDK 1.4
    The setDefaultLookAndFeelDecorated method requires JDK 1.4 version.

  • IPad2 on Windows 7 : MTP USB Device = This device cannot start. (Code 10)

    Hi Guys,
    I want to access to the Internal Storage of my iPad 2 on Windows 7.
    But I have an error with the MTP USB Device => This device cannot start. (Code 10)
    So I cannot see my iPad in Windows Explorer.
    I tried many actions from Forums :
    update the driver to the "Apple Mobile Device USB Driver" located in "C:\Program Files\Common Files\Apple\Mobile Device Support\Drivers" 
    delete the upper and lower filters in REGEDIT : {36FC9E60-C465-11CF-8056-444553540000}.
    stop and restart the service "Apple Mobile Device"
    But as soon as I connect again the iPad there is the same error message after Installing device driver software => "Device driver software was not successfully installed" : MTP USB Device : Fail
    Is there someone who get the solution ?
    Thank you for you help
    Stephane

    I have a similar problem, only mine is Code 31 for the MTP USB Driver.  The Apple driver loads fine, and I'm able to sync with iTunes, but I can't connect to the device as a drive and copy the photos off of it.
    I've tried nearly everything at this point that has been suggested in other threads, and nothing has seemed to work.

  • Pavilion dv9700 DVD/CD ROM stopped working: Code 10 (This device cannot start.)

    I have a HP Pavilion dv9700 running Windows 7 where the DV)D/CD ROM drive fails to be detected. I can still get it to open and close. The device manager gives an error: Code 10 (This device cannot start). I read somewhere that iTunes upgrades can cause DVD problems in HPs, and I did upgrade iTunes a couple of days ago. I did upgrade the BIOS a few moments ago, but it didn't help. Thank you in advance for any help you can provide.

    Thank you for the responses! Sorry it took me so long to implement--I wanted to back everything up first before messing with the registry. Following the instructions to delete lines in the registry AND uninstalling iTunes allowed for the DVD/CD ROM to pop up with an exclamation mark in my Device Manager. Updating the driver did not help as the computer said the driver was up-to-date. Mysteriously, when I rebooted, the DVD/CD ROM disappeared from the device manager again. I forgot to mention in the initial post that the DVD/CD ROM light blinks steadily at about two blinks/second. Any other ideas? I am wondering if this is a hardware failure now.

  • Sound card problem - This device cannot start. (Code

    hi all,
    here's my situation...
    i had a dell dimension 4400 that came with a sound blaster li've! value(wdm) sound card. i recently got a new motherboard/case etc. i transferred the sound card to my new system and i get a "This device cannot start. (Code 0)" error when i check device manager. for some reason, the game port on the sound card is working fine, but the audio processor part has the error. windows recognizes the card, but it won't use it. the card is a little over 3 years old.
    now, i've read the forums, tried a clean install, registry tweaks, changed bios settings, even did a hd format. i also tried different pci slots. i have sp2 and all my other drivers are updated.
    the new motherboard i have is a gigabyte 8ipe000g. i already contacted gigabyte, did not get much help. it has onboard ac97 audio. i disabled the onboard audio, but it did not seem to change anything. i have also tried windows drivers, the dell drivers from the cd, and the drivers from the creative website. none of them changed anything. i am now having trouble removing the drivers from add/remove programs. i keep removing them, but they still remain, even after using the wdm driver remover from the cd (a file named ctapxx.exe, or something similar). it's almost like windows is not actually installing the drivers when i install them. i'm wondering if the code 0 error is specifically driver related.
    the first time i disabled the onboard audio and updated the drivers a weird thing happened. every time i started the computer up it would crash when it got to the desktop. it no longer does this for some reason, everything now starts up, but i have no audio. the sound card is the only device giving me problems on my system.
    is there anything else i need plugged into the sound card? all i have is the sound card plugged into the pci slot, and an audio cord going from the card to my dvd dri've. is there anything that is supposed to go from the card directly to the motherboard? as far as i can tell, i have everything hooked up correctly. i don't understand why the game port works, but not the audio processor.
    so, i have basically tried everything. seems like quite a few people get code 0 errors with some sort of hardware they have, but it usually seems like there is no definite solution.
    does anyone have a similar problem, or a solution? hopefully i don't have to get a new sound card. i would just stick with my onboard audio, but i hear it can cause problems with games.

    Since you have a new board it maybe a bios setting.
    Is there IRQ conflict from the soundcard.
    Maybe remove the card and unistall the software, use a tool "driver cleaner pro" to remove all creative files.
    Check your mainboard manual on what pci slot that dont share, i hear slot 3 is the one to use, i use slot 5.
    Fit the card and reinstall.
    Best of luck.

  • I cannot get this code to work...

    This code is annoying me to no end. I cannot seem to get it
    to work. I can get it to work, but all of my buttons disappear,
    along with everything else. EXCEPT, it keeps my home button, and
    makes two of them.... Now,I have no idea why, but help would be
    VERY appreciated.
    <SCRIPT language=JavaScript>
    dCol='404040';//date colour.
    fCol='0000FF';//face colour.
    sCol='FF0000';//seconds colour.
    mCol='000000';//minutes colour.
    hCol='000000';//hours colour.
    ClockHeight=30;
    ClockWidth=30;
    ClockFromMouseY=100;
    ClockFromMouseX=200;
    //Alter nothing below! Alignments will be lost!
    d=new
    Array("SUNDAY","MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY");
    m=new
    Array("JANUARY","FEBRUARY","MARCH","APRIL","MAY","JUNE","JULY","AUGUST","SEPTEMBER","OCTO BER","NOVEMBER","DECEMBER");
    date=new Date();
    day=date.getDate();
    year=date.getYear();
    if (year < 2000) year=year+1900;
    TodaysDate=" "+d[date.getDay()]+" "+day+"
    "+m[date.getMonth()]+" "+year;
    D=TodaysDate.split('');
    H='...';
    H=H.split('');
    M='....';
    M=M.split('');
    S='.....';
    S=S.split('');
    Face='1 2 3 4 5 6 7 8 9 10 11 12';
    font='Arial';
    size=1;
    speed=0.6;
    ns=(document.layers);
    ie=(document.all);
    Face=Face.split(' ');
    n=Face.length;
    a=size*10;
    ymouse=0;
    xmouse=0;
    scrll=0;
    props="<font face="+font+" size="+size+"
    color="+fCol+"><B>";
    props2="<font face="+font+" size="+size+"
    color="+dCol+"><B>";
    Split=360/n;
    Dsplit=360/D.length;
    HandHeight=ClockHeight/4.5
    HandWidth=ClockWidth/4.5
    HandY=-7;
    HandX=-2.5;
    scrll=0;
    step=0.06;
    currStep=0;
    y=new Array();x=new Array();Y=new Array();X=new Array();
    for (i=0; i < n; i++){y
    =0;x=0;Y
    =0;X=0}
    Dy=new Array();Dx=new Array();DY=new Array();DX=new Array();
    for (i=0; i < D.length; i++){Dy
    =0;Dx=0;DY
    =0;DX=0}
    if (ns){
    for (i=0; i < D.length; i++)
    document.write('<layer name="nsDate'+i+'" top=0 left=0
    height='+a+' width='+a+'><center>'+props2+D
    +'</font></center></layer>');
    for (i=0; i < n; i++)
    document.write('<layer name="nsFace'+i+'" top=0 left=0
    height='+a+'
    width='+a+'><center>'+props+Face+'</font></center></layer>');
    for (i=0; i < S.length; i++)
    document.write('<layer name=nsSeconds'+i+' top=0 left=0
    width=15 height=15><font face=Arial size=3
    color='+sCol+'><center><b>'+S
    +'</b></center></font></layer>');
    for (i=0; i < M.length; i++)
    document.write('<layer name=nsMinutes'+i+' top=0 left=0
    width=15 height=15><font face=Arial size=3
    color='+mCol+'><center><b>'+M+'</b></center></font></layer>');
    for (i=0; i < H.length; i++)
    document.write('<layer name=nsHours'+i+' top=0 left=0
    width=15 height=15><font face=Arial size=3
    color='+hCol+'><center><b>'+H
    +'</b></center></font></layer>');
    if (ie){
    document.write('<div id="Od"
    style="position:absolute;top:0px;left:0px"><div
    style="position:relative">');
    for (i=0; i < D.length; i++)
    document.write('<div id="ieDate"
    style="position:absolute;top:0px;left:0;height:'+a+';width:'+a+';text-align:center">'+pro ps2+D+'</B></font></div>');
    document.write('</div></div>');
    document.write('<div id="Of"
    style="position:absolute;top:0px;left:0px"><div
    style="position:relative">');
    for (i=0; i < n; i++)
    document.write('<div id="ieFace"
    style="position:absolute;top:0px;left:0;height:'+a+';width:'+a+';text-align:center">'+pro ps+Face
    +'</B></font></div>');
    document.write('</div></div>');
    document.write('<div id="Oh"
    style="position:absolute;top:0px;left:0px"><div
    style="position:relative">');
    for (i=0; i < H.length; i++)
    document.write('<div id="ieHours"
    style="position:absolute;width:16px;height:16px;font-family:Arial;font-size:16px;color:'+ hCol+';text-align:center;font-weight:bold">'+H+'</div>');
    document.write('</div></div>');
    document.write('<div id="Om"
    style="position:absolute;top:0px;left:0px"><div
    style="position:relative">');
    for (i=0; i < M.length; i++)
    document.write('<div id="ieMinutes"
    style="position:absolute;width:16px;height:16px;font-family:Arial;font-size:16px;color:'+ mCol+';text-align:center;font-weight:bold">'+M
    +'</div>');
    document.write('</div></div>')
    document.write('<div id="Os"
    style="position:absolute;top:0px;left:0px"><div
    style="position:relative">');
    for (i=0; i < S.length; i++)
    document.write('<div id="ieSeconds"
    style="position:absolute;width:16px;height:16px;font-family:Arial;font-size:16px;color:'+ sCol+';text-align:center;font-weight:bold">'+S+'</div>');
    document.write('</div></div>')
    (ns)?window.captureEvents(Event.MOUSEMOVE):0;
    function Mouse(evnt){
    ymouse =
    (ns)?evnt.pageY+ClockFromMouseY-(window.pageYOffset):event.y+ClockFromMouseY;
    xmouse =
    (ns)?evnt.pageX+ClockFromMouseX:event.x+ClockFromMouseX;
    (ns)?window.onMouseMove=Mouse:document.onmousemove=Mouse;
    function ClockAndAssign(){
    time = new Date ();
    secs = time.getSeconds();
    sec = -1.57 + Math.PI * secs/30;
    mins = time.getMinutes();
    min = -1.57 + Math.PI * mins/30;
    hr = time.getHours();
    hrs = -1.575 + Math.PI *
    hr/6+Math.PI*parseInt(time.getMinutes())/360;
    if (ie){
    Od.style.top=window.document.body.scrollTop;
    Of.style.top=window.document.body.scrollTop;
    Oh.style.top=window.document.body.scrollTop;
    Om.style.top=window.document.body.scrollTop;
    Os.style.top=window.document.body.scrollTop;
    for (i=0; i < n; i++){
    var F=(ns)?document.layers['nsFace'+i]:ieFace
    .style;
    F.top=y + ClockHeight*Math.sin(-1.0471 +
    i*Split*Math.PI/180)+scrll;
    F.left=x
    + ClockWidth*Math.cos(-1.0471 + i*Split*Math.PI/180);
    for (i=0; i < H.length; i++){
    var HL=(ns)?document.layers['nsHours'+i]:ieHours.style;
    HL.top=y
    +HandY+(i*HandHeight)*Math.sin(hrs)+scrll;
    HL.left=x+HandX+(i*HandWidth)*Math.cos(hrs);
    for (i=0; i < M.length; i++){
    var ML=(ns)?document.layers['nsMinutes'+i]:ieMinutes
    .style;
    ML.top=y+HandY+(i*HandHeight)*Math.sin(min)+scrll;
    ML.left=x
    +HandX+(i*HandWidth)*Math.cos(min);
    for (i=0; i < S.length; i++){
    var
    SL=(ns)?document.layers['nsSeconds'+i]:ieSeconds.style;
    SL.top=y
    +HandY+(i*HandHeight)*Math.sin(sec)+scrll;
    SL.left=x+HandX+(i*HandWidth)*Math.cos(sec);
    for (i=0; i < D.length; i++){
    var DL=(ns)?document.layers['nsDate'+i]:ieDate
    .style;
    DL.top=Dy +
    ClockHeight*1.5*Math.sin(currStep+i*Dsplit*Math.PI/180)+scrll;
    DL.left=Dx
    + ClockWidth*1.5*Math.cos(currStep+i*Dsplit*Math.PI/180);
    currStep-=step;
    function Delay(){
    scrll=(ns)?window.pageYOffset:0;
    Dy[0]=Math.round(DY[0]+=((ymouse)-DY[0])*speed);
    Dx[0]=Math.round(DX[0]+=((xmouse)-DX[0])*speed);
    for (i=1; i < D.length; i++){
    Dy=Math.round(DY
    +=(Dy[i-1]-DY)*speed);
    Dx
    =Math.round(DX+=(Dx[i-1]-DX
    )*speed);
    y[0]=Math.round(Y[0]+=((ymouse)-Y[0])*speed);
    x[0]=Math.round(X[0]+=((xmouse)-X[0])*speed);
    for (i=1; i < n; i++){
    y=Math.round(Y
    +=(y[i-1]-Y)*speed);
    x
    =Math.round(X+=(x[i-1]-X
    )*speed);
    ClockAndAssign();
    setTimeout('Delay()',50);
    if (ns||ie)window.onload=Delay;
    </SCRIPT>

    That is a problem with the Speed Dial extension.
    See [[Troubleshooting extensions and themes]]

  • In formcentral, why does the "proceed to checkout" button not work? on IE I get error " This content cannot be displayed in a frame...

    In formcentral, why does the "proceed to checkout" button not work? on IE I get error " This content cannot be displayed in a frame. To help protect the security of information you enter into this website, the publisher of this content does not allow it to be displayed in a frame ". On Chrome I get nothing but loading.

    Hi,
     This error is generally specific to Internet Explorer and has two possible causes. The most likely explanation is that your browser has unusual browser security settings. I would recommend you try
    resetting your security settings to defaults (varies by version but all essentially the same). You may also have to turn off
    Protected Mode which is enabled by default on some systems. If you’re seeing this error (or a version of it) outside Internet Explorer, you may have a server-level setting that is preventing your content from being framed.
    Reference:https://social.technet.microsoft.com/Forums/exchange/en-US/1460c5a5-6242-4402-9f6b-bc581bf56478/content-cannot-be-displayed-in-a-frame-when-trying-to-add-item?forum=sharepointgeneral
    Thanks,
    Eric
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Eric Tao
    TechNet Community Support

  • HT1386 Why can't I sync my iPad to pc, it says this iPad cannot be used because the apple mobile device service is not started

    Why can't I sync my iPad to pc, it says this iPad cannot be used because the Apple mobile device service is not stated, the last time they were synced was December and I had no problem.

    Log in as an Admin User on your PC. Type 'Services' in the search area above when you click on start. (or see control panel and select Admistrative Tools.)
    Select the Services shortcut.  In the window that appears with your listed service, navigate to ipod service, Apple Mobile Device service, and, Bonjour Services.  Doubleclick them to get the property page.  Change startup to automatic, click apply.  Then click start,
    There is a known issue that when iTunes updates it incorrectly sets the Service startup type - this is normally due to installations on Vista and win7 services and  drivers that run in the Local Sstem requiring Admin account permissions that are not always granted with User Account Elevation, when running installations or updates in User account.
    Normally the Local System is set to inherit the User account permission token when being set up - but Apple in their infinite wisdom have a higher token in place for their services.  so a standard user cannot derogate the required elevation, even with the UAC to admin prompt, since the local system is owned by the Machine account and only Admin, bBackup, Restore, Machine, operator accounts carry the same descriptor permissions on process ownership to set these services correctly.
    Third party security programs, such as Kaspersky can also limit installations by User account installations, which adds to the problem.  I have had a few installations fail, even in Admin mode - because Kaspersky sits on par with the Main Machine Administrator account for watching program and installation directories and registry keys - (which have  higher privilege levels in some respects than the ordinary Admin account you normally start a new machine in before you add any other user accounts- all very confusing - but that's Microsoft all over for you.
    Follow Ralph's advice if you do not have the necessary software already installed.  You should install Apple's Application Management Software - which will look after the installation of all required elements for you and notify you of updates pending.  In options have it set to Notify only - not all updates may be requred, and this option allows you to see what is being installed.  It is good practice to set all updating software to Notify only - especially any thirdparty software - much of which carry all sorts of little 'extra's' you  may not need or want.
    It is also good practice to keep an eye on your Program and Features option in control panel, just to see what is being installed and when - including Windows updates.
    Sorry about the long reply, but with December being your last sync - a lot can change in the meantime. Best be prepared.
    Best wishes, Ct

  • This device cannot find enough free resources that it can use. (Code 12)

    Got the above error when i insert a firewire card with via chipset. I have update the firewire driver by picking a list of device driver from my computer and though it prompt me to restart but yet it still shows the yellow exclamation mark and next i update it through online, same thing it prompt me to restart which i did but sad to say it shows the yellow exclamation again
    When i check under properties>general tab, it says the following Quote
    This device cannot find enough free resources that it can use. (Code 12)
    If you want to use this device, you will need to disable one of the other devices on this system.
    You need to restart your computer before the changes you made to this device will take effect.
    Click 'Check for solutions' to send data about this device to Microsoft and to see if there is a solution available.
    As far as i know the irq in bios setup is all set as auto and the total there's 4 pci slot and only 1 that is using, so how can it be resources being used up?? 
    Fyi i'm using Msi P35 neo3 mobo with vista ultimate sp1

    Under device manager> VIA OCHI Compliant IEEE 1394 host controller> right click it and choose update driver follow by choosing the option of search automatically for updated software (window would search your computer and the internet for the lastest driver software for your device)
    Once done i reboot and next bingo.... the yellow exclamation was no longer there, infact it was quite wierd when i try updating online, as the very first time it doesn't work but wouldn't know why the second time it does  

  • Zen 8G This device cannot start code 10 and firmware update problem

    I have read the threads in the forums on the same problem that I am having. It seems that there are few solutions for this and the ones that have been posted I have tried. Basically the problem is this, I made the silly mistake of trying to update the firmware on my Zen 8G since it was listed as a critical update. I downloaded the firmware but it failed and took me to the recovery screen. Instead of working with this, again silly me, I tried to use the Creative recovery tool. This downloaded the firmwary and started rebooting the player. At this point it just hung. I left it on for about 3 hours and nothing happened and it wouldn't turn off so I hit the reset button on the player. Now when I connect it to the computer it recognizes it as a creative zen but if I try to download the firmware the software says the player is not connected when it is. When I check the device driver, even though it shows it as a creative zen it says "This device cannot start code 0"? I have the latest Microsoft device driver loaded and it still doesn't work.
    I have tried this on two different computers, one using XP and the other using Vista. I get the same problem with each. It appears to me that the problem is not really with the device driver but somehow with the firmware. However, I am not an expert at this stuff.
    If anyone could please help I would appreciate it. This was a gift for my wife for the Christmas of 2007 so it is just out of warranty and the service people won't help.

    GRe: Zen 8G This device cannot start code 0 and firmware update problem?Hello Tbg99,
    Welcome to Creative forums!
    Try booting the player in the recovery mode.
    . While the ZEN is off, press and hold down the play/pause button.
    2. While holding down the play/push button, push the reset button slowly using a paper clip/pin. You should feel the "click" sound when press it.
    3. Slide the On/Off switch towards the power button and hold it down until the recovery boot screen appears.
    Choose Clean Up then Reboot. If problem still persists, you may need to format the ZEN but take note that formatting will delete the contents of the device. To format the ZEN, boot the ZEN in the recovery mode again and choose Format this time.

  • In device manager it says code 10 - this device cannot start (read message)

    In device manager next to the icon for pioneer DVD-RW DVR K17A Device it has a yellow ! triangle and when i click on it, it says this device cannot start code 10. I got the laptop in June and hadnt noticed the problem til now. When i followed instructions to possbily install updated drivers/software i did so but was told i am up to date.
    Thanks

    Hi,
    I had this exact problem yesterday. I suspect you're running Vista right? The other guy made a good point about saying what machine you've got and what OS you run, so I offer this advice with the disclaimer that I can't be 100 per cent sure it's your problem. However, I've had the exact same problem (referencing the "code 10") recently on my laptop which runs Vista. I called up support and they said there's a bunch of software, especially for things like MP3 players and digital cameras, which is compatible with vista +but+ causes the DVD / CD drive to stop working. He directed me to a page that talks you through a registry patch, which both he and the page itself advises is a little risky. That said, I did the patch and now the DVD / CD drive works. Or that is, it actually reads the DVD before citing some other reason why it can't be played (some worthless advice about reducing screen resolution and colour quality - haven't got any ideas about that have you?).
    Here is the address of the page with the registry patch:
    support.microsoft.com/kb/929461
    Again, I'm not a techie, I'm not at all expert about dealing with computer probs and since I don't know what OS you're running and on what machine I can't be sure this applies to you. But it seems like it does.

  • Why this code is not working??? java script

    gen_validatorv2.js
         JavaScript Form Validator
    Version 2.0.2
         Copyright 2003 JavaScript-coder.com. All rights reserved.
         You use this script in your Web pages, provided these opening credit
    lines are kept intact.
         The Form validation script is distributed free from JavaScript-Coder.com
         You may please add a link to JavaScript-Coder.com,
         making it easy for others to find this script.
         Checkout the Give a link and Get a link page:
         http://www.javascript-coder.com/links/how-to-link.php
    You may not reprint or redistribute this code without permission from
    JavaScript-Coder.com.
         JavaScript Coder
         It precisely codes what you imagine!
         Grab your copy here:
              http://www.javascript-coder.com/
    function Validator(frmname)
    this.formobj=document.forms[frmname];
         if(!this.formobj)
         alert("BUG: couldnot get Form object "+frmname);
              return;
         if(this.formobj.onsubmit)
         this.formobj.old_onsubmit = this.formobj.onsubmit;
         this.formobj.onsubmit=null;
         else
         this.formobj.old_onsubmit = null;
         this.formobj.onsubmit=form_submit_handler;
         this.addValidation = add_validation;
         this.setAddnlValidationFunction=set_addnl_vfunction;
         this.clearAllValidations = clear_all_validations;
    function set_addnl_vfunction(functionname)
    this.formobj.addnlvalidation = functionname;
    function clear_all_validations()
         for(var itr=0;itr < this.formobj.elements.length;itr++)
              this.formobj.elements[itr].validationset = null;
    function form_submit_handler()
         for(var itr=0;itr < this.elements.length;itr++)
              if(this.elements[itr].validationset &&
         !this.elements[itr].validationset.validate())
              return false;
         if(this.addnlvalidation)
         str =" var ret = "+this.addnlvalidation+"()";
         eval(str);
    if(!ret) return ret;
         return true;
    function add_validation(itemname,descriptor,errstr)
    if(!this.formobj)
         alert("BUG: the form object is not set properly");
              return;
         }//if
         var itemobj = this.formobj[itemname];
    if(!itemobj)
         alert("BUG: Couldnot get the input object named: "+itemname);
              return;
         if(!itemobj.validationset)
         itemobj.validationset = new ValidationSet(itemobj);
    itemobj.validationset.add(descriptor,errstr);
    function ValidationDesc(inputitem,desc,error)
    this.desc=desc;
         this.error=error;
         this.itemobj = inputitem;
         this.validate=vdesc_validate;
    function vdesc_validate()
    if(!V2validateData(this.desc,this.itemobj,this.error))
    this.itemobj.focus();
              return false;
    return true;
    function ValidationSet(inputitem)
    this.vSet=new Array();
         this.add= add_validationdesc;
         this.validate= vset_validate;
         this.itemobj = inputitem;
    function add_validationdesc(desc,error)
    this.vSet[this.vSet.length]=
         new ValidationDesc(this.itemobj,desc,error);
    function vset_validate()
    for(var itr=0;itr<this.vSet.length;itr++)
         if(!this.vSet[itr].validate())
              return false;
         return true;
    function validateEmailv2(email)
    // a very simple email validation checking.
    // you can add more complex email checking if it helps
    if(email.length <= 0)
         return true;
    var splitted = email.match("^(.+)@(.+)$");
    if(splitted == null) return false;
    if(splitted[1] != null )
    var regexp_user=/^\"?[\w-_\.]*\"?$/;
    if(splitted[1].match(regexp_user) == null) return false;
    if(splitted[2] != null)
    var regexp_domain=/^[\w-\.]*\.[A-Za-z]{2,4}$/;
    if(splitted[2].match(regexp_domain) == null)
         var regexp_ip =/^\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\]$/;
         if(splitted[2].match(regexp_ip) == null) return false;
    }// if
    return true;
    return false;
    function V2validateData(strValidateStr,objValue,strError)
    var epos = strValidateStr.search("=");
    var command = "";
    var cmdvalue = "";
    if(epos >= 0)
    command = strValidateStr.substring(0,epos);
    cmdvalue = strValidateStr.substr(epos+1);
    else
    command = strValidateStr;
    switch(command)
    case "req":
    case "required":
    if(eval(objValue.value.length) == 0)
    if(!strError || strError.length ==0)
    strError = objValue.name + " : Required Field";
    }//if
    alert(strError);
    return false;
    }//if
    break;
    }//case required
    case "maxlength":
    case "maxlen":
    if(eval(objValue.value.length) > eval(cmdvalue))
    if(!strError || strError.length ==0)
    strError = objValue.name + " : "+cmdvalue+" characters maximum ";
    }//if
    alert(strError + "\n[Current length = " + objValue.value.length + " ]");
    return false;
    }//if
    break;
    }//case maxlen
    case "minlength":
    case "minlen":
    if(eval(objValue.value.length) < eval(cmdvalue))
    if(!strError || strError.length ==0)
    strError = objValue.name + " : " + cmdvalue + " characters minimum ";
    }//if
    alert(strError + "\n[Current length = " + objValue.value.length + " ]");
    return false;
    }//if
    break;
    }//case minlen
    case "alnum":
    case "alphanumeric":
    var charpos = objValue.value.search("[^A-Za-z0-9]");
    if(objValue.value.length > 0 && charpos >= 0)
    if(!strError || strError.length ==0)
    strError = objValue.name+": Only alpha-numeric characters allowed ";
    }//if
    alert(strError + "\n [Error character position " + eval(charpos+1)+"]");
    return false;
    }//if
    break;
    }//case alphanumeric
    case "num":
    case "numeric":
    var charpos = objValue.value.search("[^0-9]");
    if(objValue.value.length > 0 && charpos >= 0)
    if(!strError || strError.length ==0)
    strError = objValue.name+": Only digits allowed ";
    }//if
    alert(strError + "\n [Error character position " + eval(charpos+1)+"]");
    return false;
    }//if
    break;
    }//numeric
    case "alphabetic":
    case "alpha":
    var charpos = objValue.value.search("[^A-Za-z]");
    if(objValue.value.length > 0 && charpos >= 0)
    if(!strError || strError.length ==0)
    strError = objValue.name+": Only alphabetic characters allowed ";
    }//if
    alert(strError + "\n [Error character position " + eval(charpos+1)+"]");
    return false;
    }//if
    break;
    }//alpha
              case "alnumhyphen":
    var charpos = objValue.value.search("[^A-Za-z0-9\-_]");
    if(objValue.value.length > 0 && charpos >= 0)
    if(!strError || strError.length ==0)
    strError = objValue.name+": characters allowed are A-Z,a-z,0-9,- and _";
    }//if
    alert(strError + "\n [Error character position " + eval(charpos+1)+"]");
    return false;
    }//if                
                   break;
    case "email":
    if(!validateEmailv2(objValue.value))
    if(!strError || strError.length ==0)
    strError = objValue.name+": Enter a valid Email address ";
    }//if
    alert(strError);
    return false;
    }//if
    break;
    }//case email
    case "lt":
    case "lessthan":
    if(isNaN(objValue.value))
    alert(objValue.name+": Should be a number ");
    return false;
    }//if
    if(eval(objValue.value) >= eval(cmdvalue))
    if(!strError || strError.length ==0)
    strError = objValue.name + " : value should be less than "+ cmdvalue;
    }//if
    alert(strError);
    return false;
    }//if
    break;
    }//case lessthan
    case "gt":
    case "greaterthan":
    if(isNaN(objValue.value))
    alert(objValue.name+": Should be a number ");
    return false;
    }//if
    if(eval(objValue.value) <= eval(cmdvalue))
    if(!strError || strError.length ==0)
    strError = objValue.name + " : value should be greater than "+ cmdvalue;
    }//if
    alert(strError);
    return false;
    }//if
    break;
    }//case greaterthan
    case "regexp":
                   if(objValue.value.length > 0)
         if(!objValue.value.match(cmdvalue))
         if(!strError || strError.length ==0)
         strError = objValue.name+": Invalid characters found ";
         }//if
         alert(strError);
         return false;
         }//if
    break;
    }//case regexp
    case "dontselect":
    if(objValue.selectedIndex == null)
    alert("BUG: dontselect command for non-select Item");
    return false;
    if(objValue.selectedIndex == eval(cmdvalue))
    if(!strError || strError.length ==0)
    strError = objValue.name+": Please Select one option ";
    }//if
    alert(strError);
    return false;
    break;
    }//case dontselect
    }//switch
    return true;
         Copyright 2003 JavaScript-coder.com. All rights reserved.
    example.html
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <title>Example for Validator</title>
    <script language="JavaScript" src="gen_validatorv2.js" type="text/javascript"></script>
    </head>
    <body>
    <form action="" name="myform" >
    <table cellspacing="2" cellpadding="2" border="0">
    <tr>
    <td align="right">First Name</td>
    <td><input type="text" name="FirstName"></td>
    </tr>
    <tr>
    <td align="right">Last Name</td>
    <td><input type="text" name="LastName"></td>
    </tr>
    <tr>
    <td align="right">EMail</td>
    <td><input type="text" name="Email"></td>
    </tr>
    <tr>
    <td align="right">Phone</td>
    <td><input type="text" name="Phone"></td>
    </tr>
    <tr>
    <td align="right">Address</td>
    <td><textarea cols="20" rows="5" name="Address"></textarea></td>
    </tr>
    <tr>
    <td align="right">Country</td>
    <td>
         <SELECT name="Country">
              <option value="" selected>[choose yours]
              <option value="008">Albania
              <option value="012">Algeria
              <option value="016">American Samoa
              <option value="020">Andorra
              <option value="024">Angola
              <option value="660">Anguilla
              <option value="010">Antarctica
              <option value="028">Antigua And Barbuda
              <option value="032">Argentina
              <option value="051">Armenia
              <option value="533">Aruba     
         </SELECT>
         </td>
    </tr>
    <tr>
    <td align="right"></td>
    <td><input type="submit" value="Submit"></td>
    </tr>
    </table>
    </form>
    <script language="JavaScript" type="text/javascript">
    //You should create the validator only after the definition of the HTML form
    var frmvalidator = new Validator("myform");
    frmvalidator.addValidation("FirstName","req","Please enter your First Name");
    frmvalidator.addValidation("FirstName","maxlen=20",
         "Max length for FirstName is 20");
    frmvalidator.addValidation("FirstName","alpha");
    frmvalidator.addValidation("LastName","req");
    frmvalidator.addValidation("LastName","maxlen=20");
    frmvalidator.addValidation("Email","maxlen=50");
    frmvalidator.addValidation("Email","req");
    frmvalidator.addValidation("Email","email");
    frmvalidator.addValidation("Phone","maxlen=50");
    frmvalidator.addValidation("Phone","numeric");
    frmvalidator.addValidation("Address","maxlen=50");
    frmvalidator.addValidation("Country","dontselect=0");
    </script>
    </body>
    </html>
    documentation.html
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <head>
         <title>JavaScript Form Validator Documentation</title>
    <Style>
    BODY, P,TD{ font-family: Arial,Verdana,Helvetica, sans-serif; font-size: 10pt }
    H1{ font-family: Arial,Verdana,Helvetica, sans-serif; font-size: 18pt; color : #000066}
    H3{ font-family: Arial,Verdana,Helvetica, sans-serif; font-size: 12pt; color : #000066 }
    A{font-family: Arial,Verdana,Helvetica, sans-serif;}
    B {     font-family : Arial, Helvetica, sans-serif;     font-size : 12px;     font-weight : bold;}
    CODE {font-family : Courier,monospace;font-size: 10pt;color : #800000;}
    CODE.htm {font-family : "Courier New", Courier, monospace;     font-size : x-small;     color : #000080;}
    </Style>
    </head>
    <body>
    <center>
    <table cellspacing="2" cellpadding="2" border="0" width="600">
    <tr><td>
         <h1>JavaScript Form Validations Made Easy!</h1>
         <h3>Documentation for JavaScript Form Validator</h3>
         <HR size=1>
         <P>
         The Form validation script is distributed free from JavaScript-Coder.com<br>
         You can use the script in your web pages for free.
         </P>
         <P>
         You may please add a link to JavaScript-Coder.com,
         making it easy for others to find this script.<br>
         Checkout the <A href="http://www.javascript-coder.com/links/how-to-link.php
         target="_blank">Give a Link & Get a Link!</A> page.
         </P>
         <P>
         <B>JavaScript Coder</B><br>
         It precisely codes what you imagine!<br>
         Grab your copy here: http://www.javascript-coder.com
         </P>
         <HR size=1>
         <P>
         Using client side JavaScript is an efficient way to validate the user input
         in web applications. When there are many fields in the form, the JavaScript
         validation becomes too complex.
         </P>
         <P>
    The JavaScript class presented here makes the form validations many times easier.
         </P>
         <P>
         The idea is to create a set of "validation descriptors" associated with each element
         in a form. The "validation descriptor" is nothing but a string specifying the type of
         validation to be performed.
         </P>
         <P>
         Each field in the form can have 0, 1, or more validations. For example, the input should
         not be empty, should be less than 25 chars, should be alpha-numeric, etc
         </P>
         You can associate a set of validation descriptors for each input field in the form.
         <a name="3"></a>
         <h3>Using The Script</h3>
         1.Include gen_validatorv2.js in your html file just before closing the HEAD tag<br><br>
         <CODE>
         <script language="JavaScript" src="gen_validatorv2.js" type="text/javascript"></script><BR>
         </head><BR>
         </CODE><br>
         2. Just after defining your form,
         Create a form validator object passing the name of the form<br><br>
         <CODE class='htm'>
          <FORM name='myform' action=""><BR>
          <!----Your input fields go here --><BR>
          </FORM><BR>
         </CODE><CODE>
          <SCRIPT language="JavaScript"><BR>
          var frmvalidator  = new Validator("myform");<BR>
         </CODE>
         <br>
         <br>
         3. Now add the validations required<br><br>
         <CODE>
              frmvalidator.addValidation("FirstName","alpha");
         </CODE><br><br>
         the first argument is the name of the field and the second argument is the
         validation descriptor, which specifies the type of validation to be performed.<br>
         You can add any number of validations.The list of validation descriptors are provided
         at the end of the documentation.<br>
         The optional third argument is the error string to be displayed if the validation
         fails.<br>
         <br>
         <CODE>
              frmvalidator.addValidation("FirstName","alpha");<br>
              frmvalidator.addValidation("FirstName","req","Please enter your First Name");<br>
              frmvalidator.addValidation("FirstName","maxlen=20",<br>
                   "Max length for FirstName is 20");          <br>
         </CODE>     <br>
         <br>
         4. Similarly, add validations for the fields where validation is required.<br>
         That's it! You are ready to go.
         <A name="3"></A>
         <h3>Example</h3>
         The example below will make the idea clearer<br>
         <CODE class="htm">
                   <form action="" name="myform" ><BR>
                   <table cellspacing="2" cellpadding="2" border="0"><BR>
                   <tr><BR>
                     <td align="right">First Name</td><BR>
                     <td><input type="text" name="FirstName"></td><BR>
                   </tr><BR>
                   <tr><BR>
                     <td align="right">Last Name</td><BR>
                     <td><input type="text" name="LastName"></td><BR>
                   </tr><BR>
                   <tr><BR>
                     <td align="right">EMail</td><BR>
                     <td><input type="text" name="Email"></td><BR>
                   </tr><BR>
                   <tr><BR>
                     <td align="right">Phone</td><BR>
                     <td><input type="text" name="Phone"></td><BR>
                   </tr><BR>
                   <tr><BR>
                     <td align="right">Address</td><BR>
                     <td><textarea cols="20" rows="5" name="Address"></textarea></td><BR>
                   </tr><BR>
                   <tr><BR>
                     <td align="right">Country</td><BR>
                     <td><BR>
                          <SELECT name="Country"><BR>
                             <option value="" selected>[choose yours]<BR>
                             <option value="008">Albania<BR>
                             <option value="012">Algeria<BR>
                             <option value="016">American Samoa<BR>
                             <option value="020">Andorra<BR>
                             <option value="024">Angola<BR>
                             <option value="660">Anguilla<BR>
                             <option value="010">Antarctica<BR>
                             <option value="028">Antigua And Barbuda<BR>
                             <option value="032">Argentina<BR>
                             <option value="051">Armenia<BR>
                             <option value="533">Aruba     <BR>
                         </SELECT><BR>
                        </td><BR>
                   </tr><BR>
                   <tr><BR>
                     <td align="right"></td><BR>
                     <td><input type="submit" value="Submit"></td><BR>
                   </tr><BR>
                   </table><BR>
                   </form><BR>
                   </CODE><CODE>
                   <script language="JavaScript" type="text/javascript"><BR>
                    var frmvalidator = new Validator("myform");<BR>
                    frmvalidator.addValidation("FirstName","req","Please enter your First Name");<BR>
                    frmvalidator.addValidation("FirstName","maxlen=20",<BR>
                        "Max length for FirstName is 20");<BR>
                    frmvalidator.addValidation("FirstName","alpha");<BR>
                    <BR>
                    frmvalidator.addValidation("LastName","req");<BR>
                    frmvalidator.addValidation("LastName","maxlen=20");<BR>
                    <BR>
                    frmvalidator.addValidation("Email","maxlen=50");<BR>
                    frmvalidator.addValidation("Email","req");<BR>
                    frmvalidator.addValidation("Email","email");<BR>
                    <BR>
                    frmvalidator.addValidation("Phone","maxlen=50");<BR>
                    frmvalidator.addValidation("Phone","numeric");<BR>
                    <BR>
                    frmvalidator.addValidation("Address","maxlen=50");<BR>
                    frmvalidator.addValidation("Country","dontselect=0");<BR>
                   </script><BR>     
         </CODE>
         <A name="4"></A>
         <h3>Some Additional Notes</h3>
         <LI type="disc">The form validators should be created only after defining the HTML form
         (only after the </form> tag. )<br>
         <LI type="disc">Your form should have a distinguished name.
         If there are more than one form
         in the same page, you can add validators for each of them. The names of the
         forms and the validators should not clash.
         <LI type="disc">You can't use the javascript onsubmit event of the form if it you are
         using this validator script. It is because the validator script automatically overrides the
         onsubmit event. If you want to add a custom validation, see the section below
         </LI>
         <A name="5"></A>
         <h3>Adding Custom Validation</h3>
         If you want to add a custom validation, which is not provided by the validation descriptors,
         you can do so. Here are the steps:
         <LI type="disc">Create a javascript function which returns true or false depending on the validation.<br>
         <CODE>
              function DoCustomValidation()<BR>
              {<BR>
                var frm = document.forms["myform"];<BR>
                if(frm.pwd1.value != frm.pwd2.value)<BR>
                {<BR>
                  alert('The Password and verified password does not match!');<BR>
                  return false;<BR>
                }<BR>
                else<BR>
                {<BR>
                  return true;<BR>
                }<BR>
              }<BR>
         </CODE><br>
         <LI type="disc">Associate the validation function with the validator object.<br>
         <CODE>
         frmvalidator.setAddnlValidationFunction("DoCustomValidation");
         </CODE><br>
         </LI>
         <P>
         The custom validation function will be called automatically after other validations.
         </P>
         <P>
         If you want to do more than one custom validations, you can do all those
         validations in the same function.
         </P>
         <CODE>
              function DoCustomValidation()<BR>
              {<BR>
                var frm = document.forms["myform"];<BR>
                if(false == DoMyValidationOne())<BR>
                {<BR>
                  alert('Validation One Failed!');<BR>
                  return false;<BR>
                }<BR>
                else<BR>
                if(false == DoMyValidationTwo())<BR>
                {<BR>
                  alert('Validation Two Failed!');<BR>
                  return false;<BR>
                }<BR>
                else<BR>
                {<BR>
                  return true;<BR>
                }<BR>
              }<BR>
         </CODE><br>
         where DoMyValidationOne() and DoMyValidationTwo() are custom functions for
         validation.
         <A name="6"></A>
         <h3>Clear All Validations</h3>
         In some dynamically programmed pages, it may be required to change the validations in the
         form at run time. For such cases, a function is included which clears all validations in the
         validator object.<br><br>
         <CODE>
         frmvalidator.clearAllValidations();
         </CODE><br>
         <br>
         this function call clears all validations you set.<br>
         You will not need this method in most cases.
         <a name="7"></a>
         <h3>Table of Validation Descriptors</h3>     
    <table cellspacing="2" cellpadding="2" border="1" width="520px">
    <tr>
    <td><FONT face=Arial size=2>
         required<BR>
         req </FONT>
         </td>
    <td><FONT face=Arial size=2>The field should not be
    empty </FONT>
         </td>
    </tr>
    <tr>
    <td><FONT face=Arial size=2>
         maxlen=???<BR>
         maxlength=???
         </td>
    <td><FONT face=Arial size=2>checks the length entered data to the maximum. For
    example, if the maximum size permitted is 25, give the validation descriptor as "maxlen=25"
         </td>
    </tr>
    <tr>
    <td><FONT face=Arial size=2>
         minlen=???<BR>
         minlength=???
         </td>
    <td><FONT face=Arial size=2>checks the length of the entered string to the
    required minimum. example "minlen=5"
         </td>
    </tr>
    <tr>
    <td><FONT face=Arial size=2>
         alphanumeric /<BR>
         alnum </FONT>
         </td>
    <td><FONT face=Arial size=2>Check the data if it
    contains any other characters other than alphabetic or numeric characters
    </FONT>
         </td>
    </tr>     
    <tr>
    <td><FONT face=Arial size=2>num <BR>
         numeric </FONT>
         </td>
    <td><FONT face=Arial size=2>Check numeric data
    </FONT>
         </td>
    </tr>
    <tr>
    <td><FONT face=Arial size=2>alpha <BR>
         alphabetic </FONT>
         </td>
    <td><FONT face=Arial size=2>Check alphabetic data.
    </FONT>
         </td>
    </tr>     
    <tr>
    <td><FONT face=Arial size=2>email </FONT>
         </td>
    <td><FONT face=Arial size=2>The field is an email
    field and verify the validity of the data. </FONT>
         </td>
    </tr>
    <tr>
    <td><FONT face=Arial size=2>lt=???<BR>
         lessthan=???
         </td>
    <td><FONT face=Arial size=2>
         Verify the data to be less than the value passed.
         Valid only for numeric fields. <BR>
         example: if the
    value should be less than 1000 give validation description as "lt=1000"
         </td>
    </tr>
    <tr>
    <td><FONT face=Arial size=2>gt=???<BR>
         greaterthan=???     </td>
    <td><FONT face=Arial size=2>
         Verify the data to be greater than the value passed.
         Valid only for numeric fields. <BR>
         example: if the
    value should be greater than 10 give validation description as "gt=10"
         </td>
    </tr>
    <tr>
    <td><FONT face=Arial size=2>regexp=??? </FONT>
         </td>
    <td><FONT face=Arial size=2>
         Check with a regular expression the value should match the regular expression.<BR>
         example: "regexp=^[A-Za-z]{1,20}$" allow up to 20 alphabetic
         characters.
         </td>
    </tr>
    <tr>
    <td><FONT face=Arial size=2>dontselect=?? </FONT>
         </td>
    <td><FONT face=Arial size=2>This
    validation descriptor is valid only for select input items (lists)
    Normally, the select list boxes will have one item saying 'Select One' or
    some thing like that. The user should select an option other than this
    option. If the index of this option is 0, the validation description
    should be "dontselect=0"
         </td>
    </tr>
    </table>
         <P>
              <table cellspacing="2" cellpadding="2" border="1" width="520">
              <tr>
              <td>
                   <B>NOTE:</B><br>
                   The HTML Form Wizard included in JavaScript Coder contains still more
                   number of validations
                   (comparison validations, check box & radio button validations and more)<br>
                   Using the wizard, you can add validations to your forms
                   without writing a single line of code! <br>
                   JavaScript Coder takes care of
                   generating the code and inserting the code in to the HTML file.<br>
                   <A href="http://www.javascript-coder.com/index.phtml
                   target="_blank">Read more about JavaScript Coder</A>
                   </td>
              </tr>
              </table>
         </P>
         <A name="8"></A>
         <h3>Example Page</h3>     
         See the <a href="example.html target="_blank"
         >JavaScript form validation example here</a>
    </td>
    </tr>
    <tr><td align="center">
         <HR><br>
         Copyright &copy; 2003 JavaScript-Coder.com. All rights reserved.
    </td></tr>
    </table>     
    </center>
    </body>
    </html>

    The code is not working because you made a mistake somewhere, duh! So figure out what (hint: firefox javascript console, it's your friend) and fix it!
    And next time when you post code: use the [ code ]  tags to pretty format your code, as it is now it's unreadable.
    http://forum.java.sun.com/help.jspa?sec=formatting

Maybe you are looking for

  • USB speaker does not work hi-speed USB 2.0 4-port ultra-mini hub

    imac desk top port to hub - no sound

  • Download file in struts - File save dialog not showing up

    Hi, The issue i have is - the file save dialog box which should be displayed on file download is not showing up. I have a DAO being called from the Action form SaveDocumentAction which extends DispatchAction and has a download(mapping, request, respo

  • Memory Leak in Mac Pro.  My Mac Pro has 16 GB memory

    The memory (as shown in the Activity Monitor) goes from a high of approximately 11 GB free memory to a low of approximately 50 MB.  The leaked memory seems to be going to "Inactive".  When the memory is on the low end, the Mac Pro is very slow, somet

  • Applying a debit memo

    Hi Gurus i know that to reverse a credit memo,you need to apply the debit memo to the creidt memo. can someone please assist on the process of applying the credit memo to the invoice and subcequently applying the debit memo to the invoice. thank you

  • ORA-04062 - very urgent, please help

    Error "ORA-04062: timestamp of package "SYS.DBMS_SNAPSHOT_UTL" has been changed" appears while refreshing materialized view with DBMS_MVIEW.REFRESH, the configuration is described below, please, any suggestions what cause the problem? I have the mast