Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Copy current address in Permanent address using javascript

Posted on 2010-08-30
3
Medium Priority
?
3,016 Views
Last Modified: 2012-05-10

Hi Experts,
I am using cascading dropdowns, for Country,State,City.
I have written a web service for this.
I have to add different dropdowns for Country-State-City as for Current address and Permanent Address.
This works well.
Now I need to copy the current address with checkbox click(Current address is same as Permanent)
I have written a javascript to set the values,but for dropdowns it is not working.
Do I need to call the web method in  web service from javascript?How?
Or is there any other way?
Thanks for your time.Your help is really appreciated.
Address.JPG
0
Comment
Question by:johny_bravo1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 60

Expert Comment

by:Kevin Cross
ID: 33557332
Since you asked for an alternative and think the issue you will have is that the values of those drop downs will not have even been filled yet; therefore, you can try this:

For the drop-downs have a textbox next to them that is the selected value (you can use JavaScript on selection change for drop down to fill the box) and read the value from this box on your page that handles the submit.  So the drop-down boxes just become a mechanism for consistent entry that is validated against the db.  You can make the textbox disabled from user entry, so as to protect this.  

Now when you check the box, all you have to do is fill the normal textboxes with values from Permanent which you can trust since they came from selection using drop downs.

Hope that makes sense.
0
 
LVL 3

Accepted Solution

by:
Astynax777 earned 2000 total points
ID: 33557888
Here's a solution...

$find the cascading drop-down behavior and then call set_SelectedValue
You should then raise the onParentChange event so it will populate the next.
var behavior = $find("<cascadingDropDownBehaviorID>");
behavior.set_SelectedValue(value);
behavior._onParentChange(null, true);

var behavior2 = $find('<nextCascadingDropDownBehaviorID>');
behavior2.set_SelectedValue(value); 
behavior2._onParentChange(null, true);
//etc...

Open in new window

0
 
LVL 8

Author Closing Comment

by:johny_bravo1
ID: 33558250
Thanks.That's exactly what I was looking for.
Thanks to all.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The task of choosing a web design company to build a website for your business should never be taken in a light manner. Provided the fact that your website will act as a representative to your business and will be responsible for imposing an online …
A while back, I ran into a situation where I was trying to use the calculated columns feature in SharePoint 2013 to do some simple math using values in two lists. Between certain data types not being accessible, and also with trying to make a one to…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question