Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    Regular Coder
    Join Date
    Jun 2008
    Posts
    682
    Thanks
    114
    Thanked 2 Times in 2 Posts

    No forms on server will submit

    Can someone tell me exactly though how to fix my code for my ajax.

    So I figured out whats going on here its a conflict between my AJAX and my form submissions, I see the issue I'm having is that I'm using AJAX when I shouldn't be using AJAX.

    Its a bit hard to explain but simply put my ajax is calling the newhandler() function when a user can click the handlers link in the sidebar and when they click the new handler button at the top.

    Up until this point everything works fine and I could almost leave it like that but this is where the issue comes into play, it loads up your form just fine but now when the user clicks the submit button on my form the function newhandler() no longer gets called because my AJAX file is the only one which can call it at this point.

    Code:
    var loadedobjects=""
    var rootdomain="http://"+window.location.hostname
    
    function ajaxpage(url, containerid)
    {
       url = 'backstagefunctions.php?f=' + url;
    
       var page_request = false
       if (window.XMLHttpRequest) // if Mozilla, Safari etc
       page_request = new XMLHttpRequest()
       else if (window.ActiveXObject)
       {
          // if IE
          try
          {
             page_request = new ActiveXObject("Msxml2.XMLHTTP")
          }
          catch (e)
          {
             try
             {
                page_request = new ActiveXObject("Microsoft.XMLHTTP")
             }
             catch (e)
             {
             }
          }
       }
       else
       {
          return false
       }
    
       page_request.onreadystatechange=function()
       {
          loadpage(page_request, containerid)
       }
    
       page_request.open('GET', url, true)
       page_request.send(null)
    }
    
    function loadpage(page_request, containerid)
    {
       if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
       document.getElementById(containerid).innerHTML=page_request.responseText
    }
    
    function loadobjs()
    {
       if (!document.getElementById)
       return
       for (i=0; i<arguments.length; i++)
       {
          var file=arguments[i]
          var fileref=""
          if (loadedobjects.indexOf(file)==-1)
          {
             //Check to see if this object has not already been added to page before proceeding
             if (file.indexOf(".js")!=-1)
             {
                //If object is a js file
                fileref=document.createElement('script')
                fileref.setAttribute("type","text/javascript");
                fileref.setAttribute("src", file);
             }
             else if (file.indexOf(".css")!=-1)
             {
                //If object is a css file
                fileref=document.createElement("link")
                fileref.setAttribute("rel", "stylesheet");
                fileref.setAttribute("type", "text/css");
                fileref.setAttribute("href", file);
             }
          }
          if (fileref!="")
          {
             document.getElementsByTagName("head").item(0).appendChild(fileref)
             loadedobjects+=file+" " //Remember this object as being already added to page
          }
       }
    }
    
    function WrestlerList()
    {
    var addWrestler = document.addwrestler.characterid.value;
    if (addWrestler) {
    document.getElementById("characterlist").innerHTML += "<li>" + addWrestler + "</li>";
    return WrestlerList;
    }
    else {
    document.getElementById("characterlist").innerHTML += "<li>This handler does not have any characters assigned.</li>";
    }
    }
    Last edited by CoolAsCarlito; 01-05-2009 at 10:15 PM.


 

Posting Permissions

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