Jump to content

All Activity

This stream auto-updates     

  1. Today
  2. justsomeguy

    return from function???

    Sounds like you've got an error stopping the other code from running. Make sure to check the console in your browser's developer tools. It might be the variable AmendForm, it doesn't look like it's defined. Pass this instead to pass the element where you have the attribute.
  3. Yesterday
  4. mickeymouse

    return from function???

    It works perfectly on my other forms so it's not a browser related problem. I'll look at the link you gave me in more detail later but right now I would prefer to find the problem and fix it rather than venture into new stuff at this time. As I said, it works in my other forms so I don't see why it shouldn't work in this one. Thanks for your help and thanks for moving the item to Javascript - I keep thinking these functions I've coded are PHP - sorry about that.
  5. justsomeguy

    return from function???

    I'll move this to Javascript since it doesn't have anything to do with PHP.
  6. justsomeguy

    return from function???

    Depends on what the browser vendors decide to do. I don't believe that method is part of the standard, so when you're talking about non-standard things you'll find that they work differently in different browsers. That will work in older browsers, sure. It might not work on mobile devices though, for example. https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault Note that those examples also attach the listener using addEventListener rather than using event attributes.
  7. mickeymouse

    return from function???

    1) Shouldn't the traditional way still work. 2) Don't know how to do the modern way.
  8. justsomeguy

    return from function???

    The modern way to do that is to get the event object inside the event handler, and cancel the default action.
  9. mickeymouse

    return from function???

    Shouldn't this code return me to my from and not take action to open the next program/file. function formcheck(myform) {alert('Form Check.'); return false;} with the following form parameters: <form name='AmendForm' action='FT_AmendUpdate.php' method='POST' onsubmit='return formcheck(AmendForm)'> Whether I use return true or return false, the submit displays the "Form Check" message and then opens the next program/file: FT_AmendUpdate.php
  10. justsomeguy

    responsive menu

    Run the toggle function when any of the links are clicked.
  11. dsonesuk

    Link to html accordion panel

    You use the url to that accordion effect with the bookmark hash < a href="theurloftheepageyouwanttogoto.html#firstlocation">click here to see the first location</a https://www.w3schools.com/code/tryit.asp?filename=FZA3F31CHH20 paste above code in place of what's here https://www.w3schools.com/w3css/tryit.asp?filename=tryw3css_accordion_active Now in the address bar add #bookmarkword to the end of url and press enter. This will represent the url with hash link from another page. Hit run Change hash to #bookmarkpara Hit run. it identifies where the bookmark is! transverses up the parent element containers <p>...</p>, <section>...</section>, <article>...</article> till it reaches a div element, set in the while loop condition. It takes the div elements id and runs the myFunction() using that id as a paremeter.
  12. P. Jongejan

    responsive menu

    I want to change the menu on https://www.w3schools.com/howto/howto_js_topnav_responsive.asp. It displays an icon on the righthandside which opens the formerly hidden menuitems underneath each other. They can be hidden again by clicking this icon again, it's a toggle-function. I like to have it collapsed automatically after a menuitem is chosen. How can this be done?
  13. dsonesuk

    Problem with unordered list with image bullets

    You use a reference that will distinguish nav bar unordered list from custom unordered list and lastly a default unordered list styling for nav bar /*default normal ul li styling*/ ul { /*yada yada yada */ } li{ /*yada yada yada */ } #navbar ul { /*yada yada yada */ } #navbar li { /*yada yada yada */ } #content .home { /*yada yada yada */ } #content .home li { /*yada yada yada */ }
  14. Speedy007

    Problem with unordered list with image bullets

    Yeah, can't do that. It messes up the nav bar list.
  15. Speedy007

    Problem with unordered list with image bullets

    OK. But what specific rule do you suggest? And my concern is that the float: left you mention targets the nav bar and that is needed.
  16. Ingolme

    Problem with unordered list with image bullets

    Remove this from your CSS and replace it with a more specific rule that only targets the elements you want it to: li { float: left; }
  17. Speedy007

    Problem with unordered list with image bullets

    They seem to want to be laid out horizontally along with the nave bar. How to override?? It passes validation now but is not lining up on the page correctly, like a list should.
  18. Speedy007

    Problem with unordered list with image bullets

    Well, I tried giving the <li> a class of .bullet and a line-height but it's still not quite right. Breaks aren't in a normal list place. Now what did I do wrong??
  19. Last week
  20. Speedy007

    Problem with unordered list with image bullets

    Thank you so much. I know I need to brush up but I needed an answer ASAP. I will work on your suggestion and hit the books again. Thank you!
  21. Ingolme

    Problem with unordered list with image bullets

    If you use CSS to set a large line-height to the <li> elements you won't need the <br> elements. You can also use margin or padding, there are a lot of options with CSS to style anything. You really should never need a <br /> element anywhere, but especially not as direct children of a <ul> element.
  22. I'm rusty and can't figure this out. My home page won't validate and is having a problem with my list. I have small images next to them instead of bullets. The only way I can make them line up vertically is to put several breaks in, which is what won't validate. I'm assuming it's a problem to line them up the normal way because of the ul navbar code but I don't know how to override that. Any help is greatly appreciated. Here's the website: nancyrobinson.biz Thank you in advance!
  23. Future Moose

    Responsive Topnav example not closing after choice

    Hi Witt, Thanks for your reply, but the problem still exists... The menu works fine when it comes to navigating to the correct anchor point (e.g. "#news"). The problem is that, even after a selection is made, the hamburger menu stays expanded until you hit the icon again... at least that's the behavior I see. With your extra "asdf<br>" lines, the hamburger menu is still expanded, but just scrolls off the top of the screen, so you can't see it. Try it... use your example, decrease width until the hamburger menu appears, select it, then "News". You should navigate to "#News" but then scroll back to the top of the page and you should see what mean. Thanks.
  24. 01Moonlight

    Link to html accordion panel

    I looked at the links, but I'm still not sure how that's going to open a panel on another page. I've done what you suggested earlier and it links to the correct page, but does not open the panel.
  25. 01Moonlight

    Open & Close W3 Accordion

    Hi - I'm using the W3 Accordion code with the flowing JS. <script type="text/javascript"> var acc = document.getElementsByClassName("accordion"); var i; for (i = 0; i < acc.length; i++) { acc.addEventListener("click", function() { this.classList.toggle("active"); var panel = this.nextElementSibling; if (panel.style.display === "block") { panel.style.display = "none"; } else { panel.style.display = "block"; } }); } </script> However, I would like to only have one tab open at a time. I found a script similar to what I'm looking for at: https://stackoverflow.com/questions/45214002/w3-accordion-auto-close-sections-and-open-close-all var acc = document.getElementsByClassName("accordion"); var i; for (i = 0; i < acc.length; i++) { acc[i].onclick = function() { if( !this.classList.contains('active') ){ closeAll(); } this.classList.toggle("active"); var panel = this.nextElementSibling; if (panel.style.maxHeight){ panel.style.maxHeight = null; } else { panel.style.maxHeight = panel.scrollHeight + "px"; } } } function openAll(){ for (i = 0; i < acc.length; i++) { acc[i].classList.add("active"); acc[i].nextElementSibling.style.maxHeight = acc[i].nextElementSibling.scrollHeight + "px"; } } function closeAll(){ for (i = 0; i < acc.length; i++) { acc[i].classList.remove("active"); acc[i].nextElementSibling.style.maxHeight = null; } } document.getElementById( 'openAll' ).addEventListener( 'click', openAll); document.getElementById( 'closeAll' ).addEventListener( 'click', closeAll); However, when I replace the code or put any other JS in, the panels no longer open. I don't know anything about JS so I don't know what's wrong. Thanks.
  26. Funce

    Internet Explorer and a Mega Menu

    Hey its no worries. There's an alternative that I use regularly on my website when I need to use create consistent page headers/navigation/menus. It does exactly as you specify. If you create a php file (Or change an existing html file to a php one) you'll be able to take your home page and do this. <!-- index.php --> <div class="dropdown"> <a href="#">Links</a> <div class="dropdown-content"> <?php include "links.html"; ?> </div> </div> The only thing is you can't test php files straight from your file system. You'll only be able to see it on the website or a local server you've set up. (if your web host supports PHP even).
  27. justsomeguy

    Filtering Feature for Website

    It's certainly simple for a seasoned developer, that's a basic part of using databases. If you don't know how to use databases then it's not going to be easy though. You need a form for people to submit whatever you want them to submit, and your code that processes the form needs to build a query with the appropriate WHERE clauses for your database structure. e.g.: SELECT * FROM people WHERE facility = 3 AND specialty = 10
  28. justsomeguy

    How do I get a stable array

    I use the MDN is the definitive Javascript reference. If I have a question about arrays I'll search for "mdn array" to get their pages about it.
  1. Load more activity
×