Client Side Things
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesClient Side Things

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old March 28th, 2003, 01:40 PM
myraleen myraleen is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Ottawa, Ontario, Canada
Posts: 123 myraleen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via ICQ to myraleen Send a message via AIM to myraleen
Not Defined needs a kick in the @55

From a form, an input box is sent to be validated with this code (in php) :

echo "<td>Agency Code:<input size="5" name="divcode" maxlength="5" onchange="isValidNEWUDC(this,$user_division_id);" value="$user_division_id START HERE!"></td>

Now this works...
It sends what the user entered to the validation, as well as their user code, which in the case i'm working on is L.

Here is the javascript validation:

function isValidNEWUDC(field, user_division_id) {
var divcode = field.value
var user_division_id = user_division_id.value;
var divLetter = divcode.substr(0,1);
if (divLetter !- user_division_id) {
alert ("DIVCODE not valid must begin with the first letter of your division")
field.focus();
field.select();
return false;
}
checkdivcode()
}


I am getting L is not defined as a javascript error.........
L is the suer's division.
What am i doing wrong???

help me, purty please!!!

Reply With Quote
  #2  
Old March 28th, 2003, 01:51 PM
myraleen myraleen is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Ottawa, Ontario, Canada
Posts: 123 myraleen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via ICQ to myraleen Send a message via AIM to myraleen
RE: Not Defined needs a kick in the @55

Also, let me say that it's not the name, i've changed the var name to user_div_id.... and it still comes up as L not defined

Reply With Quote
  #3  
Old March 28th, 2003, 03:40 PM
myraleen myraleen is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Ottawa, Ontario, Canada
Posts: 123 myraleen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via ICQ to myraleen Send a message via AIM to myraleen
RE: Not Defined needs a kick in the @55

Not that anyone's answered....

But it was syntax, on the first page, that calls the function $user_division_id should have been
'$user_division_id'


Reply With Quote
  #4  
Old March 31st, 2003, 07:11 AM
ResNet9 ResNet9 is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 101 ResNet9 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via AIM to ResNet9
RE: Not Defined needs a kick in the @55

Not that is this is helpful, but maybe js isn't the way to go if validating the if the data is important.

Although it's a much bigger pain in the butt, re-posting the page to itself and checking the values with a similar php function would accomplish the same thing. If the values are wrong, give an error. If not, mabye do a redirect to the next page or something like that.

sorry it wasn't js help but I'm not a js fan, and I seem to always shy away from it unless its totally unavoidable. just because data is checked with js doesn't mean that is what is hitting the db

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesClient Side Things > Not Defined needs a kick in the @55


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway