SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Zealot DBallerz01's Avatar
    Join Date
    Jan 2004
    Location
    CT
    Posts
    172
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    dropdown menu dissapears after clicking on it

    I have a form in the drop down and I can't edit the fields without it dissapearing after clicking. Here is the code

    Code:
    						<a data-toggle="dropdown" href="ace/#" class="dropdown-toggle" >
    								<img class="nav-user-photo" src="ace/assets/avatars/user.jpg" alt="Jason's Photo" />
    								<span class="user-info">
    								<?php if ($user=="") {echo"<small>Register!,</small>Guest!";}else{echo"<small>Welcome,</small>User!";}?>
    								</span>
    
    								<i class="icon-caret-down"></i>
    							</a>
    							
    
    						<?php if ($user_id == "") {?>
    						            <div class="dropdown-menu"  style="padding: 15px; padding-bottom: 0px;">
                    <form action="index.php" method="post"> 
                        Username:<br /> 
                        <input type="text" name="username" class="dropdown" value="<?php echo $submitted_username; ?>" /> 
                        <br />
                        Password:<br /> 
                        <input type="password" name="password" class="dropdown" value="" /> 
                        <br />
                        <input type="submit" class="btn btn-info" value="Login" /> 
                    </form> 
                </div>
          <script type="text/javascript">
    $('.dropdown-menu input').click(function(event){
    	event.stopPropagation();
    });
    </script>
    http://websbests.com-Top Rated Sites Of The Web Brought By YOU!
    (submit your site guys)

    http://howology.com-Explaining How To Do Stuff ...One Step A Time

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,156
    Mentioned
    190 Post(s)
    Tagged
    2 Thread(s)
    Sorry, it might be the Holiday, but I can't see anything obvious. Got a link to an online page with the problem?

  3. #3
    SitePoint Zealot DBallerz01's Avatar
    Join Date
    Jan 2004
    Location
    CT
    Posts
    172
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Mittineague View Post
    Sorry, it might be the Holiday, but I can't see anything obvious. Got a link to an online page with the problem?
    this is the page:http://collegeexchange.org/budget/index.php

    it happens when you click the register link, a pop up shows up, but when you click the input field, it disappears.
    http://websbests.com-Top Rated Sites Of The Web Brought By YOU!
    (submit your site guys)

    http://howology.com-Explaining How To Do Stuff ...One Step A Time

  4. #4
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,156
    Mentioned
    190 Post(s)
    Tagged
    2 Thread(s)
    I get a bunch of
    Warning: Empty string passed to getElementById().
    Source File: http://ajax.googleapis.com/ajax/libs.../jquery.min.js
    Line: 4
    Code being minified and me being tired isn't very helpful, but Im wondering if
    Code JavaScript:
    $('.dropdown-menu input').click(function(event){
    might be going to the ul's that have that class but no input tags and hence causing empty strings?

  5. #5
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    5,938
    Mentioned
    214 Post(s)
    Tagged
    12 Thread(s)
    If you look at the page in your browser's dev tools, I see:

    Code:
    Uncaught ReferenceError: $ is not defined index.php:282
    Uncaught TypeError: Cannot call method 'replace' of undefined jquery.flot.min.js:28
    The first error means that you are trying to use the jQuery syntax before including the library.

    I'd try fixing both those errors and seeing if that helps.

    If not, could you make a bare bones example that demonstrates your problem.
    Your current page contains over 1,200 lines of code.
    Try to reduce that to about 50 - 100.

  6. #6
    SitePoint Zealot DBallerz01's Avatar
    Join Date
    Jan 2004
    Location
    CT
    Posts
    172
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Pullo View Post
    If you look at the page in your browser's dev tools, I see:

    Code:
    Uncaught ReferenceError: $ is not defined index.php:282
    Uncaught TypeError: Cannot call method 'replace' of undefined jquery.flot.min.js:28
    The first error means that you are trying to use the jQuery syntax before including the library.

    I'd try fixing both those errors and seeing if that helps.

    If not, could you make a bare bones example that demonstrates your problem.
    Your current page contains over 1,200 lines of code.
    Try to reduce that to about 50 - 100.
    haha it was executing before jquery was loaded. Thank you .
    http://websbests.com-Top Rated Sites Of The Web Brought By YOU!
    (submit your site guys)

    http://howology.com-Explaining How To Do Stuff ...One Step A Time


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •