473,608 Members | 1,820 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Javascript and MS Edge behaviour

Purple
404 Recognized Expert Contributor
I have the following Javascript function to manage the edit of a field on a bootstrap modal web page. It works fine with Chrome but Edge does a page reload after completion which closes the modal.

Any thoughts on why this is happening? Suggestions to stop it?
Expand|Select|Wrap|Line Numbers
  1. function edit(element) {
  2.     if (document.getElementById(element + "-glyph").className == "glyphicon glyphicon-pencil") {
  3.         document.getElementById(element).readOnly = false;
  4.         document.getElementById(element + "-glyph-remove").style.visibility = "visible";
  5.         document.getElementById(element + "-can").style.visibility = "visible";
  6.         document.getElementById(element + "-glyph").className = "glyphicon glyphicon-ok";
  7.         document.getElementById(element + "-glyph").title = "save?";
  8.         document.getElementById(element).focus();
  9.         return true;
  10.     }
  11. }
  12.  
Jan 20 '16 #1
1 1162
Purple
404 Recognized Expert Contributor
Ok - update, I found the issue..

There was an issue with my handling of a button in the HTML.

I had set the type to submit rather than button..
Jan 20 '16 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

10
6699
by: Andy Fish | last post by:
Hi, can anybody put forward a sensible argument javascript's behaviour of creating a new global variable whenever I assign to a previously undeclared variable. I can't beleive this is just for the sake of convenience (surely we learned this much from basic). here's my proposal: all "global" (document scope) variables must be declared by 'var' outside a function block.
2
5122
by: Steve | last post by:
Hi, I've come across what appears to be a bug in the rendering engine of internet explorer when a document is opened by showModalDialog. Basically any elements that should render to the right hand edge of the window (i.e. Horizontal rules, 100% tables) fall short by around 15 - 20 pixels or so. I'm currently using internet explorer 6 and have created two simple pages to demonstrate the behavior. My original pages were much more complicated...
13
9423
by: Kai Grossjohann | last post by:
It seems that Ctrl-N in Mozilla opens a new empty browser window. That's fine, I don't need to do anything about it. But Ctrl-N in IE appears to clone the current window. Is there a way to intercept the key so that I can do stuff on the server side to make the new window behave correctly? (We have a JSP-based webapp which stores state in the session. Now if two windows access (and modify!) the same session, then madness will result....
11
1528
by: delerious | last post by:
Which code is preferrable? Code A: <script type="text/javascript"> function someFunc() { // stuff } </script> <body>
2
1983
by: Cynthia | last post by:
I'm looking for javascript code that when I mouse over a menu item will display a picture elsewhere on the page. I know it exists, but the ones I've found so far just swap out the menu item in place. Even better would be one where I can swap the menu image and display an image elsewhere on the page. Many thanks!
1
1532
by: Joe | last post by:
Hi folks, Been looking at this for the day so any ideas would be appreciated. Here's the scenario, bear with me - it looks more complicated than it is :) I have a page templating system that inherits from the page class and adds a mixture of usercontrols and literals when requested. One of the usercontrols is a menu that expands on being clicked using DHTML. What I'm trying to do is to persist the expanded menu to other pages or
18
1889
by: Tom Cole | last post by:
I'm working on a small Ajax request library to simplify some tasks that I will be taking on shortly. For the most part everything works fine, however I seem to have some issues when running two requests at the same time. The first one stops execution as the second continues. If I place either an alert between the two requests or run the second through a setTimeout of only 1 millisecond, they both work. You can see a working example here:...
2
2446
by: davidson1 | last post by:
Hai friends..for menu to use in my website..i found in one website....pl look below website.... http://www.dynamicdrive.com/dynamicindex1/omnislide/index.htm i downloaded 2 files.... menuitems.js mmenu.js
5
2681
by: loveshack | last post by:
Can anyone help me please (i am quite a novice, but having fun learning). Im not sure if this is an ASP problem, a javascript problem or a browser problem. Firstly, everything i have written works fine in IE7 and beta IE8. My pages do not work however in Safari or Firefox, and please dont beat me, but i use Frontpage to write my site, and i use iframes as ive not discovered how to do this any differently! So the issue is this, i have a...
9
17838
by: mshepard | last post by:
I am very new to Javascript and would like some advise for the following... a. Declare a variable named rNumber = to the value returned from the randInt() function using 5 as the parameter value. b. Declare a variable named rAd = to the text string returned from the adDesrciption() function using rNumber as the parameter value. c. Declare a variable named rLink = to the URL returned from the adLink() function using rNumber as the...
0
8013
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8503
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8488
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8360
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6831
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
3977
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4039
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2482
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1345
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.