Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > Other ASP.NET > ASP.NET 1.x and 2.0 Application Design
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
ASP.NET 1.x and 2.0 Application Design Application design with ASP.NET 1.0, 1.1, and 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.x and 2.0 Application Design section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 5th, 2007, 03:44 AM
Registered User
 
Join Date: May 2007
Location: pune, maharastra, India.
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to prashant_telkar Send a message via MSN to prashant_telkar Send a message via Yahoo to prashant_telkar
Default problem in registration form

i m designing registration form.i hav created a drop down box which contains list of different cities.now if the user does not find any particular city then i hav given choice for OTHER option..now problem comes when he selects OTHER option i want a new textbox to visible and can enter his uniqne city which is not in dropdown box.


plz help with code and explanation

prashant
  #2 (permalink)  
Old July 5th, 2007, 03:54 AM
Friend of Wrox
Points: 1,935, Level: 17
Points: 1,935, Level: 17 Points: 1,935, Level: 17 Points: 1,935, Level: 17
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2004
Location: United Kingdom
Posts: 550
Thanks: 0
Thanked 1 Time in 1 Post
Default

So where do you find the problem, use the onchange event of dropdown and write a javascript function, here check the dropdown's selected value or text for Others, and display the textbox. You can write something like below:

sel: id of dropdown
txt: id of textbox
var obj = document.getElementById("sel");
            if (obj.options[obj.selectedIndex].text == "Others")
            {
                document.getElementById("txt").style.visibility = "visible";
            }
            else
            {
                document.getElementById("txt").style.visibility = "hidden";
            }

Regards
Mike

Don't expect too much, too soon.
  #3 (permalink)  
Old July 9th, 2007, 04:23 AM
Registered User
 
Join Date: May 2007
Location: pune, maharastra, India.
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to prashant_telkar Send a message via MSN to prashant_telkar Send a message via Yahoo to prashant_telkar
Default

hi Mike thank u for the code......but i would not get onchange event of dropdown box, i m able to get in dropdown events like selectedindex change and ontextchange events....plz give more instructions......waiting for ur reply asap

prashant
  #4 (permalink)  
Old July 9th, 2007, 07:20 AM
Friend of Wrox
Points: 1,935, Level: 17
Points: 1,935, Level: 17 Points: 1,935, Level: 17 Points: 1,935, Level: 17
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2004
Location: United Kingdom
Posts: 550
Thanks: 0
Thanked 1 Time in 1 Post
Default

Well, the onchange event will work for both server side and client side controls, although you may not find it in Intellisense, just write it, and check the result.

Regards
Mike

Don't expect too much, too soon.
  #5 (permalink)  
Old July 10th, 2007, 04:07 AM
Registered User
 
Join Date: May 2007
Location: pune, maharastra, India.
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to prashant_telkar Send a message via MSN to prashant_telkar Send a message via Yahoo to prashant_telkar
Default

Warning 1 Validation (ASP.Net): Attribute 'Onchange' is not a valid attribute of element 'DropDownList'. E:\Demotestpage\Default.aspx 180 72 E:\Demotestpagehi mike i tried the code with onchange event but it gave the above warning and its not working


dont know wat to do .......help

prashant
  #6 (permalink)  
Old July 11th, 2007, 01:09 AM
Friend of Wrox
Points: 1,935, Level: 17
Points: 1,935, Level: 17 Points: 1,935, Level: 17 Points: 1,935, Level: 17
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2004
Location: United Kingdom
Posts: 550
Thanks: 0
Thanked 1 Time in 1 Post
Default

Well well, I have been using this for a long time, try the below code and let us know if you are still facing problems:

<asp:DropDownList id="DropDownList1" runat="server" onchange="alert('test')">
                <asp:ListItem>First</asp:ListItem>
                <asp:ListItem>Second</asp:ListItem>
            </asp:DropDownList>

Regards
Mike

Don't expect too much, too soon.
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with trigger in registration form prashant_telkar SQL Server 2000 2 July 9th, 2007 06:52 PM
Registration Form Help invisible bunny king Classic ASP Databases 7 February 5th, 2007 05:30 PM
server registration problem pitter SQL Server 2005 2 December 30th, 2005 11:22 AM
server registration problem pitter SQL Server 2000 1 December 27th, 2005 04:53 AM



All times are GMT -4. The time now is 09:13 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.