RE: [DQSD-Users] Unfinished UkRail search, problem setting dropdown

2004-08-04 Thread Paul Birch
Tom,

Did you get a reply to this? I took a look at it but my JavaScript isn't
good enough to figure it (yet!). I'd be keen to see the finished result once
it's working.

Cheers,

Paul

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Tom Corcoran
Sent: 28 July 2004 22:26
To: DQSD
Subject: [DQSD-Users] Unfinished UkRail search, problem setting dropdown


I am trying to put together a search for ukrail using Shawn's cool
parseArgsEx fix for date parsing.

Running the attached tying in the searchbar :

ukrail /from newcastle /to london waterloo /outtime 15:30

leaves the time of travel set to 15, and 30, which is not valid. I can't
figure out why the comma is added. A commented out windows alert in the
search shows the value is 15 and I also try hardcoding it to 15 but it
still adds the comma.

Any thoughts?

Cheers, Tom.






---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.732 / Virus Database: 486 - Release Date: 29/07/2004
 



---
This SF.Net email is sponsored by OSTG. Have you noticed the changes on
Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
one more big change to announce. We are now OSTG- Open Source Technology
Group. Come see the changes on the new OSTG site. www.ostg.com
___
To unsubscribe visit:
https://lists.sourceforge.net/lists/listinfo/dqsd-users
[EMAIL PROTECTED]
http://sourceforge.net/mailarchive/forum.php?forum_id01


RE: [DQSD-Users] Unfinished UkRail search, problem setting dropdown

2004-08-04 Thread Kim Gräsman
Paul, Tom,

For what it's worth, I looked at it for a while when Tom first posted, but I
couldn't sort it out. The search is showing some really weird behavior.
Then again, my JavaScript skills aren't celestial either.

Best of luck,
Kim

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of 
 Paul Birch
 Sent: den 4 augusti 2004 18:56
 To: [EMAIL PROTECTED]
 Subject: RE: [DQSD-Users] Unfinished UkRail search, problem 
 setting dropdown
 
 Tom,
 
 Did you get a reply to this? I took a look at it but my 
 JavaScript isn't good enough to figure it (yet!). I'd be keen 
 to see the finished result once it's working.
 
 Cheers,
 
 Paul
 
 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of 
 Tom Corcoran
 Sent: 28 July 2004 22:26
 To: DQSD
 Subject: [DQSD-Users] Unfinished UkRail search, problem 
 setting dropdown
 
 
 I am trying to put together a search for ukrail using Shawn's 
 cool parseArgsEx fix for date parsing.
 
 Running the attached tying in the searchbar :
 
 ukrail /from newcastle /to london waterloo /outtime 15:30
 
 leaves the time of travel set to 15, and 30, which is not 
 valid. I can't figure out why the comma is added. A commented 
 out windows alert in the search shows the value is 15 and I 
 also try hardcoding it to 15 but it still adds the comma.
 
 Any thoughts?
 
 Cheers, Tom.



---
This SF.Net email is sponsored by OSTG. Have you noticed the changes on
Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
one more big change to announce. We are now OSTG- Open Source Technology
Group. Come see the changes on the new OSTG site. www.ostg.com
___
To unsubscribe visit:
https://lists.sourceforge.net/lists/listinfo/dqsd-users
[EMAIL PROTECTED]
http://sourceforge.net/mailarchive/forum.php?forum_id=8601


RE: [DQSD-Users] Unfinished UkRail search, problem setting dropdown

2004-08-04 Thread Shawn K. Hall
Hi Tom,

 Running the attached tying in the searchbar :

 ukrail /from newcastle /to london waterloo /outtime 15:30

Had a chance to look at your code today...

You did not have several of the form elements required to make your
code work (notably the outHourField and outMinuteField, but the ret
fields, as well).

And it looks like the biggest potential problem was with your
comparison operator - you were using = instead of ==. In
JavaScript you compare values using ==, not =. I've attached a 'fixed'
and working copy. I didn't add any new functionality, so it doesn't
include the ability to schedule return times yet. I leave that as an
excersize for the reader. ;)

Lastly, it doesn't like the default of 'today' if the current local pc
time is after the UK time. Since it's tomorrow there and only today
here, this would be a bit of a pain to correct easily. Fortunately
this is probably not going to be much of an issue for those of us that
are 'remote' - since finding out what time the rail departs today is
likely not an issue. ;)

Regards,

Shawn K. Hall
http://ReliableAnswers.com/

'// 
 You can name your own salary here  -  I call mine Fred
search function=ukrail
  nameUK National rail enquiries/name
  categoryPeople and Places/category
  contributorTom Corcoran/contributor
  linkhttp://www.nationalrail.co.uk/planmyjourney/time_table/journey_requirements.asp/link
  email/email
  description
  /description
  form name=ukrailf
method=post
action=http://www.nationalrail.co.uk/planmyjourney/time_table/Home_Validate_Timetable.asp;

input type=hidden name=0 value= /
input type=hidden name=1 value= /
input type=hidden name=3 value= /
input type=hidden name=11 value= /
input type=hidden name=datesel value=custom /
input type=hidden name=datesel value=tomorrow /
input type=hidden name=9 value=D /
input type=hidden name=14 value= /
input type=hidden name=outHourField value= /
input type=hidden name=outMinuteField value= /
input type=hidden name=retHourField value= /
input type=hidden name=retMinuteField value= /

COMMENT
  The input element, 9, was a SELECT element Depart/Arrive
  The input element, outHourField, was a SELECT element 00..23
  The input element, outMinuteField, was a SELECT element 00/15/30/34
  The input element, 27, was a SELECT element Unlimited changes/Direct trains/Three changes/Two changes/One change
  The input element, 12, was a SELECT element Depart/Arrive
  The input element, retHourField, was a SELECT element 00..23
  The input element, retMinuteField, was a SELECT element 00/15/30/34
/COMMENT

  /form
  script![CDATA[
function ukrail(q)
{
  if( nullArgs(ukrail,q) )
return false;
  else
  {
var args = parseArgsEx(q, from, to, via, date, outtime, outdepart, outarrival, latest, today, tomorrow, changes);

if( args.switches.length  0 )
{
  for( var j=0; jargs.switches.length; j++ )
  {
switch( args.switches[j].name )
{
  case from:
document.ukrailf[0].value = args.switches[j].value;
break;
  case to:
document.ukrailf[1].value = args.switches[j].value;
break;
  case via:
document.ukrailf[3].value = args.switches[j].value;
break;
  default:
break;
  case date:
document.ukrailf[11].value = args.switches[j].value;
break;
  case outtime:
outtime = args.switches[j].value;
outhour = outtime.substring(0,2);
outmin = outtime.substring(3,5);
document.ukrailf[outHourField].value = outhour;
document.ukrailf[outMinuteField].value = outmin;
break;
  case outarrival:
document.ukrailf[9].value = D;
break;
  case outdepart:
document.ukrailf[9].value = A;
break;
}
  }
  if (document.ukrailf[11].value == '')
  {
var dat = new Date();
var today = dat.getDate().toString();
document.ukrailf[11].value = today;
  }
}
  }  
  submitForm(ukrailf);
}
  ]]/script
  copyright
The following applies if this file is included and distributed with Dave's Quick Search Deskbar:
Copyright (c) 2002 David Bau; Distributed under the terms of the GNU Public License, Version 2 (http://www.gnu.org/copyleft/gpl.txt)
  /copyright
  created_by
This search file was initially created on 01/12/04 at 11:39:21
by Dave's Quick Search Deskbar Search Wizard version 1.2,
Copyright (c) 2002 Glenn Carr; Distributed under the terms of the GNU General Public License, Version 2