legendgod Posted July 22, 2004 Posted July 22, 2004 Dear Xtremers, I have 4 dropdownlist controls which let users to select the task Starttime and endtime: There is a datagrid which have 2 controls in each of the editItemtemplate. They are (in editItemTemplate A:) StartTimeHrDDL, StartTimeMinDDL & (in editItemTemplate B:) EndTimeHrDDL, EndTimeMinDDL. And because these controls are created in runtime. I place the validator control in the end of editItemTemplate B too. I found no problem when compare EndTimeHrDDL with StartTimeHrDDL (I want to make sure EndTime should not be lesser then StartTime). However, I want to perform the same validation to the StartTimeMinDDL & EndTimeMinDDL ONLY if StartTimeHrDDL = EndTimeHrDDL. Because I cannot write a if..else statement in the runtime (if it is possible, please teach me!), I try to call a function like <%# GetResult() %> to get the result of the validation between StartTimeHrDDL & EndTimeHrDDL but fail. Could anyone give me some idea? Thanks Quote http://blog.legendgod.com
Arch4ngel Posted July 22, 2004 Posted July 22, 2004 This validation could easily be done on the client-side. My idea is to use Javascript (or VBScript) to make a client validation. It's time so it's easily "decryptable" by Javascript and since it's DDL... user won't mess up everything. Go with Javascript Quote "If someone say : "Die mortal !"... don't stay to see if he isn't." - Unknown "Learning to program is like going out with a new girl friend. There's always something that wasn't mentioned in the documentation..." - Me "A drunk girl is like an animal... it scream at everything like a cat and roll in the grass like a dog." - Me after seeing my girlfriend drunk and some of her drunk friend. C# TO VB TRANSLATOR
legendgod Posted July 23, 2004 Author Posted July 23, 2004 However since it is a edit/update/cancel datagrid, the dropdownlist will be generated only in runtime. How to apply Javascript? May I ask another question here: how to call a Javascript function in aspx function? And vice versa? Thank you. Quote http://blog.legendgod.com
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.