Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
1.20/5 (2 votes)
See more:
Aspx page :

fileupload
dropdownlist subject
Textarea
User can write anything in textarea.There is no sequence, that user can first write text or upload file.Dropdownlist has onchange and selected indexchanged event.Onchange event calling javascript function which convert '<',to it's html encode character if textarea contain.On selectedindex change appropriate script of that subject code get added into textarea replacing previous one.It is not necessary that user should select subject for script,can write it's own.Every thing is working properly over here.When I selecting file other than text I want hide dropdownlist subject and want to make index at zero. Suppose I uploaded text file,selected subject which inserted script into textarea,now I want to select img rather than text file,if I do, dropdownlist get disable and show first value document.getElementById('ddlSubject').selectedIndex = 0.Textarea is empty.Every thing is working properly here .But when I again select textfile,textarea and dropdownlist get enable.If I choose one subject which was selected previously,serverside event of dropdownlist did not get fired.If I choose other subject it call server side function.How to handle this

What I have tried:

Suppose I uploaded text file,selected subject which inserted script into textarea,now I want to select img rather than text file,if I do, dropdownlist get disable and show first value document.getElementById('ddlSubject').selectedIndex = 0.Textarea is empty.Every thing is working properly here .But when I again select textfile,textarea and dropdownlist get enable.If I choose one subject which was selected previously,serverside event of dropdownlist did not get fired.If I choose other subject it call server side function
Posted
Comments
Sergey Alexandrovich Kryukov 8-Jun-16 1:50am    
You really need to create some self-containing minimal code sample focusing on one single problem and post it using "Improve question". Please read carefully:
What have you tried so far?
See also: SSCCE.

If possible, try to make is pure HTML+CSS; all server-side aspects are hardly relevant.

—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900