Hai,
I want to write validations for textboxes using Javascript which is binded to datalist. .For Every datalist item textbox id is changing,How can we write validations for these textboxes using Javascript??
Regards,
Sree
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Aug 12, 2013, 9:07 PM EDT
refer to this link for details any problem reply.
http://yasserzaid.wordpress.com/2009/04/08/access-the-control-inside-a-datalist-using-javascript/
Iftikar HussainRank #423 · 5.9K reputationPosted Aug 12, 2013, 9:20 PM EDT
Instead of using javascript you can directly use Validation Control. which will automatically take care of all textboxes id. Can you share your code?
Regards,
Iftikar
sree29 reputationPosted Aug 12, 2013, 9:48 PM EDT
This is my datalist i tried to use required field validator,it is showing validation for each item in datalist.
I need to raise only perticular textbox validation with button click for each item.
Redards,
Sree
Iftikar HussainRank #423 · 5.9K reputationPosted Aug 12, 2013, 9:52 PM EDT
Regards,
Iftikar
sree29 reputationPosted Aug 12, 2013, 9:55 PM EDT
Iftikar HussainRank #423 · 5.9K reputationPosted Aug 12, 2013, 9:56 PM EDT
sree29 reputationPosted Aug 12, 2013, 10:01 PM EDT
when the Button was Click
TextBox :
Button :
Iftikar HussainRank #423 · 5.9K reputationPosted Aug 12, 2013, 10:06 PM EDT
Regards,
Iftikar
sree29 reputationPosted Aug 12, 2013, 10:10 PM EDT
Iftikar HussainRank #423 · 5.9K reputationPosted Aug 12, 2013, 10:13 PM EDT
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Aug 12, 2013, 10:27 PM EDT
as you are using RequiredFieldValidator it will work for all textbox(txtEdit) inside your datalist .
plz provide your screen shot what exactly you want.
sree29 reputationPosted Aug 13, 2013, 12:45 AM EDT
Thank u Sanjeeb Lenka And Iftikar Hussain i got required output using Itemcommand.Insted of writing code at client side ,I wrote code at server side using Datalist ItemComand.
Regards
Sree