?
Solved

Copy current address in Permanent address using javascript

Posted on 2010-08-30
3
Medium Priority
?
2,933 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

Cyber Threats to Small Businesses (Part 2)

The evolving cybersecurity landscape presents SMBs with a host of new threats to their clients, their data, and their bottom line. In part 2 of this blog series, learn three quick processes Webroot’s CISO, Gary Hayslip, recommends to help small businesses beat modern threats.

Question has a verified solution.

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

New Relic recently released its Synthetics product that allows for the creation of performance monitors that periodically test a site's performance. If you wish to test an interactive workflow New Relic employs Selenium WebDriverJS to run those test…
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
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

777 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