hi all,
i got problem on field validation, could someone help me? i figure it as below:
- i need fill up an array in client side JS with data from database and i will use for reference to validation (SELECT SN from package where PO='YU123456')

- then in the web interface show 30 field of INPUTBOX (name like inputbox1 until inputbox30). The input box will be fill-up by user.

OK now i can't imagine and got stuck to figure it. Can someone write code for me? in 30 field of INPUTBOX i need validate the input when user left the InputBox(OnBlur) to the next inputbox. the validation base on record in array, i need that coding validate like this (let say : if inputbox1 is not like as record in array, alert (The record is not valid) it will validate till last INPUTBOX30).

if someone have the other way or best solution pls write it for me.

I programed it using ASP.

Sorry my bad English.

ok i try put a part of my code to show..here is

<script type="text/javascript">
function Validate(m){
var val = m.toUpperCase();
var myArray = new Array();

myArray[0] = "Serial1";
myArray[1] = "Serial2";
myArray[2] = "Serial3";
myArray[3] = "Serial4";
myArray[4] = "Serial5";
myArray[5] = "Serial6";

}

</script>


<input type=text name="PLT1" size=24 class="contentsmall" onBlur="Validate(this.value)"/>
<input type=text name="PLT2" size=24 class="contentsmall" onBlur="Validate(this.value)"/>
<input type=text name="PLT3" size=24 class="contentsmall" onBlur="Validate(this.value)"/>
<input type=text name="PLT4" size=24 class="contentsmall" onBlur="Validate(this.value)"/>

i need JS validate data input box when they onBlur. i try to do like this :

- If <input type=text name="PLT1" size=24 class="contentsmall" onBlur="Validate(this.value)"/> value is not same data within array list, do alert("SN you entered is not valid.")
-else go to next inputbox, and so on..


the array list extract from DB and have no problem with DB connect.only for compare data.


let me know if u have any concern.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.