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.


>> REGISTER NOW TO START POSTING


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

Results 1 to 4 of 4

Thread: Obsolete code

  1. #1
    Junior Member
    Join Date
    Jul 2010
    Posts
    2
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Obsolete code

    The code on my web site is obsolete and no longer supported by the creating company. Can anyone help me correct the following section

    // CHECK NUMERIC FORMAT
    			// provide one of the following:
    			//	min=q; if the value is an ID, and you want it > q to be valid..
    			//	max=r; if the value is an ID, and you want it < r to be valid..
    			if ((e.type == "text" || e.type == "textarea") && (e.numeric || (e.min != null) || (e.max != null)) && !isblank(e.value)) {
    				var v = parseFloat(e.value);
    				var v2 = e.value.replace(/,/, "");
     
    				if ((isNaN(v)) || (isNaN(v2)) || ((e.min != null) && (v < e.min)) || ((e.max != null) && (v > e.max))) {
    					errors += "- The field " + getDisplay(e) + " must be a number";
    					errorsf += "- Le champ " + getDisplay(e) + " doit Ítre un nombre";
     
    					if (e.min != null) {
    						errors += " that is greater than " + e.min;
    						errorsf += " c'est plus grand que " + e.min;
    					}
     
    					if (e.max != null && e.min != null) {
    						errors += " and less than " + e.max;
    						errorsf += " et moins que " + e.max;
    					} else if (e.max != null) {
    						errors += " that is less than " + e.max;
    						errorsf += " c'est moins que " + e.max;
    					}
     
    					errors += ".\n";
    					errorsf += ".\n";
    				}
     
    			}

    In the latest version of Safari (and I am told Chrome) this code rejects all inputs with the error message "The field must be a number etc." It was suggested that I remove this check which I did. This resulted in a different type of error message "Element Title is undefined in Attributes"
    Thanks
    Last edited by lostinjava; July 25th, 2010 at 12:41 PM.


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Obsolete code

    error message "Element Title is undefined in Attributes"
    Is that error from the IDE or from the javac compiler? I don't recognize it.

    What line in the source causes the error?

  3. The Following User Says Thank You to Norm For This Useful Post:

    lostinjava (July 25th, 2010)

  4. #3
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,318
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: Obsolete code

    Based upon your question and the code, this looks more like javascript question than a java question. If that's the case I suggest you post this on a dedicated javascript forum - this forum is for java (there is a big difference).

  5. The Following User Says Thank You to copeg For This Useful Post:

    lostinjava (July 25th, 2010)

  6. #4
    Junior Member
    Join Date
    Jul 2010
    Posts
    2
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Re: Obsolete code

    Thanks for the help, I now know Java and Java script are different! I have a lot to learn since programming in the 60's and 70's. Sorry for posting on the wrong Forum off to find a Java script forum now!