Link to home
Start Free TrialLog in
Avatar of Sudhanshum
Sudhanshum

asked on

Jquery not working properly on Edge

I am attaching demo code,  Basically same code working OK on IE11, Chrome, Safari but getting failed on Edge, Here are 2 pages:
1> contact1.aspx
     It is without master page, Basically its calling Jquery function on textbox change, when I put special character for eg &# and click on submit button
   then it shows alert of special character and same time it calling update button on codebehind. What i want is if special character entered and click on submit
button then it should just display alert message and submit button event should not be called, Same thing working on Chrome,IE11, Safari.
2> ContactusN.aspx
    It is with master page, Basically its calling Jquery function on textbox change, when I put special character for eg &# and click on submit button
   then it shows alert of special character and same time it calling update button on code behind. What i want is if special character entered and we click on submit
button then it should just display alert message and submit button event should not be called, Same thing working on Chrome,IE11, Safari.


   Please help me to fix this issue.
Avatar of Sudhanshum
Sudhanshum

ASKER

I kept each page code one by one on attached doc file.
DemoCode.docx
Avatar of Michel Plungjan

It is very hard to eyeball debug your code.

Perhaps make a jsfiddle.net that shows the actual issue in a simple format


Do you have console messages at all?


What's the idea behind the 


  javascript: window.history.forward(1);

Open in new window

in the first page?


Also these will register an event handler to each ID 



$('#' + id).change(function () { CheckSP(); });
$('#' + idMul).change(function () { CheckSPMul(); });

Open in new window



You should use a class and use 

$('.classSP').on("change",CheckSP);
$('.classSPMul').on("change",CheckSPMul);

Open in new window


I have not used jsfiddle.net before, Can you guide me little on that?
Also I have used ID because I want to monitor if any textbox of page, special character is entered then we should show them alert and stop going further.

Just go to jsfiddle.net, Click CLOSE in the top menu to get an empty fiddle.

Enter HTML in the top left, JS in the bottom left and CSS in the top right.

Then choose the framework in the top left of the JavaScript frame, selecting bottom of head for example if your code is fully contained. Your DOC really has far too much code to figure out.



Ok I will try, I have asp.net code, I wanted to upload entire project but they doesnt allow.

Well this is not an ASP related issue. If you can boil it down to only the thing that goes wrong and put just that HTML and script in a fiddle it will be much easier to test

is that mean I will just copy jquery and html files?

Just use the RELEVANT jquery and HTML files. And only enough of them to show the issue. No need for a complete HTML file when you only need one textbox. No need for a complete JS file when you only need the function that fails

This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.