C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Articles » ASP.NET/Web Applications »

JavaScript setting values


Posted Date: 13 Mar 2004    Resource Type: Articles    Category: ASP.NET/Web Applications
Author: SivaMember Level: Gold    
Rating: 1 out of 5Points: 3



However, this textbox cannot be hidden by setting visible to false, as it will then not be rendered. The solution is make the textbox invisible by setting the border to none, the backcolor to transparent and the forecolor to the same as the form background.


function DoActivity3() {
var theform = document.Form1;
var iSeek = 0;
var cboActivity3 = theform.cboActivity3;
i = cboActivity3.selectedIndex;
iSeek = cboActivity3.options[i].value;
theform.txtActivityId3.value = iSeek;
}


Siva




Responses

Author: Ranga Senal Fernando    01 Sep 2004Member Level: Bronze   Points : 0
Well hope this is bit late to response to this message ..

---Problem---
anyways i prefer its good to add my hand on experience on this issue , i assume that Siva trying to retrieve seleted value of a dropdown box which is populated by a javascript code.
I had the same situation [what Siva has mention above ]with one of my program. What it was is to retrive selected value from a dropdownlist which is populated by Javascript.

--Solution---
its no need to assing selected value to a extra text box. what you only have to do is regues the value by the control name .Keep in mind in this situation u can not put the name of the control that u have put in design mode .. acctually u have to put the control name which has genarated my the ASP.NET
for example your control name can be "drpCustomers" in Desing time but when rendering HTML to the browser the control name would be something like "from1drpCustomers" u can see it by opening your page in viewsource mode.
so put that name in ' page.request.form("from1drpCustomers") then u can retrieve the selected value of the drpdownbox...
if anybody not clear wht i'm saying just mail me back or add a comment. then i will find some free time to make a sample and send it to you :)
bye
Agnar


Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Using JavaScript to save roundtrips
Previous Resource: Finding -From what page was the message posted to the log?
Return to Discussion Resource Index
Post New Resource
Category: ASP.NET/Web Applications


Post resources and earn money!
 
More Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use