Here's an idea :
When you generate the HTML, when IMEI is needed, generate a text box
:
<input type=3D"text" name=3D"IMEIxx" value=3D"">
When IMEI is not needed, generate a hidden field :
<input type=3D"hidden" name=3D"IMEIxx" value=3D"noIMEI">
In this way, you're sure that things are symmetrical. The "xx" is
the label for your nth mobile. This label has to be generated by ASP.
So
when you want to validate your field, go through all IMEIxx and check
if any
of them is empty or contains string of wrong format.
Since the hidden IMEIxx fields can't be changed by users and its
value isn't empty string, you can be sure that this field passes safely
through validation.
HTH
PS: I don't understand what you meant by "combobox".
> -----Message d'origine-----
> De : Paulo Fernandes [mailto:paulofernandes@c...]
> Envoy=C3=A9 : jeudi 19 d=C3=A9cembre 2002 11:40
> =C3=80 : javascript
> Objet : [javascript] Form validation problem - Mixing
> JavaScript and ASP
> ???
>
>
> Hi, guys....
>
> I have a table that looks like this:
>
>
> ----- --------- --------------
> | id | product | imeirequired |
> ----- --------- --------------
> | 1 | Sony | yes |
> ----- --------- --------------
> | 2 | Philips | yes |
> ----- --------- --------------
> | 1 | Pionner | no |
> ----- --------- --------------
>
>
> On a form on my webpage, I'm filling up a combobox base on a database
> query that returns the "product" field.
>
> I have another field on the form called "imeirequired" , which has to
> check and see if the "imeirequired" on the database is set to yes. If
> so, the form cannot be submitted without the imeirequired field being
> filled. If not, the form may be submitted without filling this field.
> And this has to be done regardless of the user's choice on the first
> combobox.
>
> Here's the question: how can I do this validation? Mixing asp and
> JavaScript? Can anyone point me in the right direction? I
> have some ASP
> knowledge but I'm totally new to JavaScript and thus any code example
> would be greatly appreciated.
>
> TIA !!!
>