Link to home
Create AccountLog in
ASP.NET

ASP.NET

--

Questions

--

Followers

Top Experts

Avatar of Johny Bravo
Johny Bravo

Copy current address in Permanent address using javascript

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

Zero AI Policy

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of Kevin CrossKevin Cross🇺🇸

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.

ASKER CERTIFIED SOLUTION
Avatar of Astynax777Astynax777🇺🇸

Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
Create Account

Avatar of Johny BravoJohny Bravo

ASKER

Thanks.That's exactly what I was looking for.
Thanks to all.

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.

ASP.NET

ASP.NET

--

Questions

--

Followers

Top Experts

The successor to Active Server Pages, ASP.NET websites utilize the .NET framework to produce dynamic, data and content-driven web applications and services. ASP.NET code can be written using any .NET supported language. As of 2009, ASP.NET can also apply the Model-View-Controller (MVC) pattern to web applications