Supreme Overlord
Gender:
Posts: 148
1008 credits Members referred : 0
« on: Jun 20, 2007, 04:47:09 PM »
I had a friend code me this tool I use on a daily basis, it works my pulling images from a real estate IDX database. It worked fine, until our MLS #'s rolled up to 6 digits instead of 5. I need to know how to change the code so I can pull pictures with 5 or 6 digits. The images are stored in sub-folders named after the last digit in the number. If you would like to see full code let me know, but I am removing the path so unknowns can't pull pictures from our MLS system without permission.
Thanks in advance for all of your help. JavaScript is not my thing....
Code:
<html> <head> <title>Photo Loader</title> <script type="text/javascript"> <!-- function checkField( ref ) { var mainPath = 'http://path...';
// CHANGE THIS ABOVE PATH TO THE COMPLETE URL PATH OF THE PHOTOS // EXAMPLE: // var mainPath = 'http://path...';
var tempNum = ref.value.substr( 4 ); var imgPath = mainPath + tempNum + '/REIS';
Supreme Overlord
Gender:
Posts: 148
1008 credits Members referred : 0
« Reply #4 on: Jun 20, 2007, 09:58:13 PM »
That didn't work, but I think it might be part of the issue. When I change line var tempNum = ref.value.substr( 4 ); to 5 it works with the 6 digit numbers, but not the 5 digit numbers anymore. Is there a command that I can use there that will use 5 for 6 digit #'s and 4 for 5 digit #'s?
I am a metal monkey!
Administrator Community Supporter?
Jedai Sword Master
Gender:
Posts: 7931
40535 credits Members referred : 3
« Reply #5 on: Jun 20, 2007, 10:00:42 PM »
Let me guess. It used to work with 4 digits and now you want it to work with 5 and 6, right?
Supreme Overlord
Gender:
Posts: 148
1008 credits Members referred : 0
« Reply #6 on: Jun 20, 2007, 10:10:53 PM »
No, it has something to do with the fact that the last digit of the number is the name of the folder it's stored in. It already works with 5 digits. For example MLS#95367 photos are stored in folder 7. And are called REIS95367, REIS95367a, RE95367b, etc through g.
So if I press Alt F4... What?
Gender:
Posts: 389
2352 credits Members referred : 2
« Reply #7 on: Jun 23, 2007, 12:48:16 AM »
if you are stil looking for an answer
Quote
<html> <head> <title>Photo Loader</title> <script type="text/javascript"> <!-- function checkField( ref ) { var mainPath = 'http://path...';
// CHANGE THIS ABOVE PATH TO THE COMPLETE URL PATH OF THE PHOTOS // EXAMPLE: // var mainPath = 'http://path...';
//changed if (ref.value.length == 5) var tempNum = ref.value.substr( 4 ); else if (ref.value.length == 6 ) var tempNum = ref.value.substr( 5 );