[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


onBlur Sent via AJAX Doesn't Fire

Posted on 2007-07-25
Medium Priority
Last Modified: 2010-05-18
I'm using AJAX to make a call to an ASP page, which returns HTML that is then added to the page. Part of HTML being returned is an input box with an onblur event. Unfortunately, the onblur event isn't firing.

The returned HTML matches some static HTML in the page exactly, with the exception of some element IDs.

Here's the static code that's loaded with the page:

      <div id="static_<%=LocationID%>">
            <span id="text_<%=LocationID%>"><%=rsLocation("Conference_Location")%></span> <font size="1"><a href="javascript:edit('<%=LocationID%>')">(edit)</a></font>
      <div id="edit_<%=LocationID%>" style="display: none;">
            <input type="text" size="40" name="edit_location" id="input_<%=LocationID%>" value="<%=rsLocation("Conference_Location")%>" onblur="edit('<%=LocationID%>')" /> <span class="btn_style" onclick="saveEdit('<%=LocationID%>')">Save</span>

And here's the code in the ASP page that is sent via AJAX to the receiving page:

      Response.Write("<div id=""static_"&LocationID&""">")
            Response.Write("<span id=""text_"&LocationID&""">"&AddLocation&"</span> <font size=""1""><a href=""javascript:edit('"&LocationID&"')"">(edit)</a></font>")
      Response.Write("<div id=""edit_"&LocationID&""" style=""display:none;"">")
            Response.Write("<input type=""text"" size=""40"" name=""edit_location"" id=""input_"&LocationID&""" value="""&AddLocation&""" oblur=""alert('Hi there')"" /> <span class=""btn_style"" onclick=""saveEdit('"&LocationID&"')"">Save</span>")

As best I can tell, the two pieces of code are essentially exact matches.

I tried placing an alert directly inside the onblur event and it didn't fire, so I'm a bit confused. Any help would be appreciated.

Question by:Shiseiryu1

Accepted Solution

mrkarr earned 2000 total points
ID: 19566829
Dude, your going to kick yourself over this one:

AddLocation&""" oblur=""alert('Hi

notice "oblur" vs onblur... done it many times... it always hurts :)

Author Comment

ID: 19567142
Wow, so much for them being just alike. :) Thanks for the help.

Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s a strangely common occurrence that when you send someone their login details for a system, they can’t get in. This article will help you understand why it happens, and what you can do about it.
A while back, I ran into a situation where I was trying to use the calculated columns feature in SharePoint 2013 to do some simple math using values in two lists. Between certain data types not being accessible, and also with trying to make a one to…
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Suggested Courses
Course of the Month18 days, 21 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question