PDA

View Full Version : Get last number and auto increment.



jason_kelly
10-30-2013, 07:57 PM
Hello,

I need your help.

I am checking for duplicates before adding in my DB. I need the help of javascript to grab the file number and auto increment it.

example:

var x = filenumber

(use regular old javascript to change the var x to var x = filenumber-2)

if (filenumber-2 already exists in db) then {

This is where I need your help:

grab the last number after the dash at the end of the string and auto increment it, resulting in var x = filenumber-3

}

This seems like rocket science to me =\