Welcome to the Java Programming Forums

The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Java Scripting Rule Issue

  1. #1
    Junior Member
    Join Date
    Jun 2012
    Thanked 0 Times in 0 Posts

    Unhappy Java Scripting Rule Issue

    I am creating a digital signature from scratch for a specialized form. The rule is working except for one part. the "invalid message" pops up as soon as anything is entered into the username. I thought that I set this up to only start the rule once "Sign" is clicked... but it's not working.
    Below is a copy of the rule:

    if (sign.clicked)
    if (username.value == 'Name')
    if (password.value == '1234')
      var dt = new Date();
      var day = dt.getDate();
      var month = dt.getMonth() + 1;
      var year = dt.getFullYear();
      date.value = month + '-' + day + '-' + year;
      date.visible = true;
      message.visible = false;
       message.visible = true;
       date.visible = false;
       date.value = '';


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Thanked 844 Times in 786 Posts
    Blog Entries

    Default Re: Java Scripting Rule Issue

    java != javascript. These are Java forums, and that looks like javascript. I've moved your thread to the other programming languages section, but you might try your luck on a javascript dedicated forum.

  3. #3
    Join Date
    Apr 2012
    Superior, CO, USA
    Thanked 14 Times in 14 Posts

    Default Re: Java Scripting Rule Issue

    In addition to what copeg said, you say "the "invalid message" pops up" but show no code that pops anythign up. And I've got to ask what:

    if (username.value == 'Name')
    if (password.value == '1234')

    this chunk of code does. Are you not familiar with the '&' operator?
    Need Java help? Check out the HotJoe Java Help forums!

Similar Threads

  1. Java tip Dec 12, 2010: Useful rule tidbits for ANTLR
    By helloworld922 in forum Java Programming Tutorials
    Replies: 2
    Last Post: December 14th, 2012, 00:33
  2. Scripting Rules for User verification
    By jwarren in forum Java Theory & Questions
    Replies: 0
    Last Post: June 29th, 2012, 08:26
  3. Java Issue / Cache issue
    By VisualPK in forum What's Wrong With My Code?
    Replies: 1
    Last Post: April 14th, 2012, 20:43
  4. Java tip Dec 12, 2010: Useful rule tidbits for ANTLR
    By helloworld922 in forum Java Code Snippets and Tutorials
    Replies: 1
    Last Post: December 16th, 2010, 11:24