Click here to Skip to main content
15,879,239 members
Home / Discussions / JavaScript
   

JavaScript

 
AnswerRe: want to help in javascript code Pin
Richard Deeming19-Feb-23 21:56
mveRichard Deeming19-Feb-23 21:56 
QuestionJavascript Pin
niveditha2216-Feb-23 22:20
niveditha2216-Feb-23 22:20 
AnswerRe: Javascript Pin
CHill6016-Feb-23 22:21
mveCHill6016-Feb-23 22:21 
QuestionHow do I make an Element slide-in, after user selects choice from drop-down, then it slides out. Pin
Garry 202316-Feb-23 12:07
Garry 202316-Feb-23 12:07 
Questionapi connection culendar Pin
jagadeesh omkaram14-Feb-23 19:00
jagadeesh omkaram14-Feb-23 19:00 
AnswerRe: api connection culendar Pin
Richard MacCutchan14-Feb-23 22:05
mveRichard MacCutchan14-Feb-23 22:05 
AnswerRe: api connection culendar Pin
Dave Kreskowiak15-Feb-23 1:32
mveDave Kreskowiak15-Feb-23 1:32 
QuestionCopying from billing address to mailing address if they are the same not working correctly Pin
samflex11-Feb-23 12:15
samflex11-Feb-23 12:15 
I have a form that asks users to provide their billing and shipping addresses.

If the billing address is same as the mailing address, click a checkbox to copy the billing address information to mailing address boxes.

So far, address, city and zip are getting copied from billing to mailing addresses but the State address is not getting copy.

The billing State has a hardcoded value of WI for Wisconsin. That NEVER changes, hence it is hardcoded.

The mailing address for State has a DropDownList of states, I am pretty sure that has to do with why the billing address for State is not getting cover over to mailing address for State.

Can you guys please see what I am doing wrong?

Here is what I am working with.
    <script type="text/javascript">
        $('#SameAsMailing').click(function () {
         if ($('input[name="SameAsMailing"]').is(':checked')) {
         $('#mailStreetAddress').val($('#instAddress').val());
         $('#mailCity').val($('#instAddressCity').val());
         var thestate = $('#instAddressState option:selected').val();
         if (thestate != "") {
                     $('#mailState option[value="' + thestate + '"]').prop('selected', true);
              }
         $('#mailZip').val($('#instAddressZip').val());
         }
       else
        {
        //Clear on uncheck
        $('#mailStreetAddress').val("");
        $('#mailCity').val("");
        $('#mailState option:eq(0)').prop('selected', true);
        $('#mailZip').val("");
       }
     });
   </script>


<asp:TableRow>
  <asp:TableHeaderCell CssClass="align-right">Install Address:</asp:TableHeaderCell>
<asp:TableCell><asp:TextBox ID="instAddress" runat="server" /></asp:TableCell>
<asp:TableHeaderCell CssClass="align-right">City:</asp:TableHeaderCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableHeaderCell CssClass="align-right">City:</asp:TableHeaderCell>
<asp:TableCell><asp:DropDownList ID="instAddressCity" OnSelectedIndexChanged="instAddressCity_Changed" AutoPostBack="true" runat="server" /></asp:TableCell>
<asp:TableHeaderCell CssClass="align-right">State:</asp:TableHeaderCell>
<asp:TableCell  CssClass="align-left"><asp:Label ID="instAddressState" runat="server" Text="WI" /></asp:TableCell>
<asp:TableHeaderCell CssClass="align-left">Zip:</asp:TableHeaderCell>
<asp:TableCell><asp:DropDownList ID="instAddressZip" runat="server" /></asp:TableCell>
</asp:TableRow>

<asp:TableRow>
<asp:TableHeaderCell CssClass="align-right">Address:</asp:TableHeaderCell>
<asp:TableCell><asp:TextBox ID="mailStreetAddress" runat="server" /></asp:TableCell>
<asp:TableHeaderCell CssClass="align-right">City:</asp:TableHeaderCell>
<asp:TableCell><asp:TextBox ID="mailCity" runat="server" /></asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableHeaderCell CssClass="align-right">State:</asp:TableHeaderCell>
<asp:TableCell><asp:DropDownList ID="mailState" runat="server"></asp:DropDownList></asp:TableCell>
<asp:TableHeaderCell CssClass="align-right">Zip:</asp:TableHeaderCell>
<asp:TableCell><asp:TextBox ID="mailZip" runat="server" /></asp:TableCell>
</asp:TableRow>


Many thanks in advance
AnswerRe: Copying from billing address to mailing address if they are the same not working correctly Pin
Richard Deeming12-Feb-23 22:02
mveRichard Deeming12-Feb-23 22:02 
GeneralRe: Copying from billing address to mailing address if they are the same not working correctly Pin
samflex13-Feb-23 5:14
samflex13-Feb-23 5:14 
QuestionAjax didn't work for cloning rows, But works for first row only Pin
amr aly3-Feb-23 8:35
amr aly3-Feb-23 8:35 
AnswerRe: Ajax didn't work for cloning rows, But works for first row only Pin
amr aly9-Feb-23 5:35
amr aly9-Feb-23 5:35 
QuestionI am using javascript to convert a large table to a pdf Pin
Zahira CHOUIBA26-Jan-23 3:22
Zahira CHOUIBA26-Jan-23 3:22 
QuestionRe: I am using javascript to convert a large table to a pdf Pin
Jeremy Falcon26-Jan-23 8:02
professionalJeremy Falcon26-Jan-23 8:02 
AnswerRe: I am using javascript to convert a large table to a pdf Pin
RickyJudith8-Feb-23 0:24
RickyJudith8-Feb-23 0:24 
QuestionI have problem importing images of Json File on HTML Table Pin
Member 1590151922-Jan-23 2:14
Member 1590151922-Jan-23 2:14 
AnswerRe: I have problem importing images of Json File on HTML Table Pin
Jeremy Falcon24-Jan-23 4:30
professionalJeremy Falcon24-Jan-23 4:30 
Questionsoftware access control Pin
Member 1589900419-Jan-23 0:51
Member 1589900419-Jan-23 0:51 
AnswerRe: software access control Pin
Richard Deeming19-Jan-23 1:25
mveRichard Deeming19-Jan-23 1:25 
QuestionUse async function to retrieve data while looping through from another function to insert objects Pin
Member 1589206711-Jan-23 23:35
Member 1589206711-Jan-23 23:35 
AnswerRe: Use async function to retrieve data while looping through from another function to insert objects Pin
Richard Deeming12-Jan-23 0:02
mveRichard Deeming12-Jan-23 0:02 
QuestionRe: Use async function to retrieve data while looping through from another function to insert objects Pin
Member 1589206712-Jan-23 1:38
Member 1589206712-Jan-23 1:38 
AnswerRe: Use async function to retrieve data while looping through from another function to insert objects Pin
Richard Deeming12-Jan-23 2:31
mveRichard Deeming12-Jan-23 2:31 
PraiseRe: Use async function to retrieve data while looping through from another function to insert objects Pin
Member 1589206712-Jan-23 3:17
Member 1589206712-Jan-23 3:17 
GeneralRe: Use async function to retrieve data while looping through from another function to insert objects Pin
Richard Deeming12-Jan-23 3:39
mveRichard Deeming12-Jan-23 3:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.