|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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!!! |
|
#2
|
|||
|
|||
|
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
|
|
#3
|
|||
|
|||
|
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' |
|
#4
|
|||
|
|||
|
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 |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Client Side Things > Not Defined needs a kick in the @55 |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|