Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6900113
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:30:20+00:00 2026-05-27T07:30:20+00:00

I declared two variables globally, first one is input text field and second is

  • 0

I declared two variables globally, first one is input text field and second is select field. When I change the option field, the local variable values set is to the global variables. But global variables didn’t got the values.

<script type="text/javascript">
var id1;
var opt1;
$(document).ready(function() {
    $("#opt").change(function() {
        id = $("#id").val();
        opt = $("#opt").val();
        id1 = id;
        opt1 = opt;
        if(!id=="" && !opt=="") {
            //alert(id);
        } else { }
     });
</script>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T07:30:21+00:00Added an answer on May 27, 2026 at 7:30 am

    The problem is down to the “minimised” formatting you’ve tried to use; it makes your code impossible to read, and therefore you’ve missed the fact that you’re missing a closing bracket. Reformatting the code will help you spot this. In addition you also used a // comment, in the middle of it which results in the rest of the line being commented out, meaning that your brackets are even more out of sync.

    The answer is to write your code in a properly indented format, rather than trying to put it all onto one line. If you want it minimised, don’t do it yourself; there are tools that can do that for you, and only do it for the copy you put online, not the copy you’re testing with; the version you work with and test with should be properly formatted.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This question is regarding wordpress . I have two variables $random_n and $adcount declared
In my stored procedure I declared two table variables on top of my procedure.
I've a structure, say SubscriptionData. Two variables of the type are declared in function
D has two types of constness: immutable variables are ones that were declared immutable,
I've declared two variables, COURSE_ID_List and COURSE_ID_timerId. They then get passed as parameters to
I have declared and initialized two variables as shown below: int a=5; char* str;
Possible Duplicate: Why are variables not local in case statements? A variable defined in
I have two classes declared like this: class Object1 { protected ulong guid; protected
I have two domains declared in my app. class Posts { String title String
I have two classes: Action and MyAction . The latter is declared as: class

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.