Results 1 to 4 of 4
  1. #1
    dapikk is offline Member
    Join Date
    Feb 2011
    Posts
    2
    Rep Power
    0

    Default AJAX + Javascript problem

    Hi,

    AJAX nor Javascript is not my cup of tea...
    I have php page submitting form thru ajax to display another form - sadly when displayion form with javascript functionality thru ajax - javascript functions have ceased to work (or maybe I'm dumb enough not to figure it out right.)
    Could anyone advise please - what sould I fix on following code:

    index file:

    Java Code:
     <script type="text/javascript">
        http = getHTTPObject();
    
        function getHTTPObject(){
          var xmlhttp;
    
          /*@cc_on
    
          @if (@_jscript_version >= 5)
            try {
              xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
            }catch(e){
              try{
              xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
            }catch(E){
              xmlhttp = false;
            }
          }
          @else
            xmlhttp = false;
          @end @*/
    
          if(!xmlhttp && typeof XMLHttpRequest != 'undefined'){
            try {
              xmlhttp = new XMLHttpRequest();
            }catch(e){
              xmlhttp = false;
            }
          }
    
          return xmlhttp;
        }
    
        function doMath1(){
          var url = "post_main.php";
    
          http.open("GET", url, true);
          http.onreadystatechange = handleHttpResponse;
    
          http.send(null);
        }
    
        function handleHttpResponse(){
          if(http.readyState == 4){
            document.getElementById('algus').innerHTML = http.responseText;
          }
        }
    
          </script>
        <div id="keskel" style="visibility: hidden">
    
        </div>
    post_main.php:

    Java Code:
      <form name="em3" id="em3" action="" method="post" target="_self">
        <input name="res3" value="" type="text" readonly="readonly">
            <input onclick="javascript:document.em3.res3.value=document.em3.butnnrr3.value;" type="button" name="butnnrr3" id="butnnrr3" value="Update">
        </form>
    The problem is that onClick is not modifying textfield anymore (when displayed thru AJAX in div - keskel)

    Any help or ideas?
    Last edited by dapikk; 02-22-2011 at 03:05 PM. Reason: x

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,271
    Blog Entries
    1
    Rep Power
    25

    Default

    I'm not sure how this relates to programming in Java as this seems a pure JavaScript problem (which is as similar to Java as ham is to hamster). If so, then your best bet is to Google for a JavaScript or AJAX forum.

    Luck.

  3. #3
    dapikk is offline Member
    Join Date
    Feb 2011
    Posts
    2
    Rep Power
    0

    Default

    Sry - just ought to ask from you guys aswell....
    Mybad....

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,271
    Blog Entries
    1
    Rep Power
    25

    Default

    Quote Originally Posted by dapikk View Post
    Sry - just ought to ask from you guys aswell....
    Mybad....
    Again, it's no big deal, and again best of luck solving your problem.

Similar Threads

  1. Problem with Ajax Tabs
    By amma2009 in forum Advanced Java
    Replies: 0
    Last Post: 02-24-2010, 03:56 PM
  2. ajax problem
    By anthrax in forum Advanced Java
    Replies: 2
    Last Post: 12-24-2009, 01:21 PM
  3. ajax jsp tag problem (formupdate.view ?)
    By anthrax in forum Advanced Java
    Replies: 1
    Last Post: 12-20-2009, 04:51 PM
  4. Java Developer – AJAX/XHTML/Javascript – Milton Keynes
    By ICResourcing in forum Jobs Offered
    Replies: 0
    Last Post: 11-09-2009, 12:04 PM
  5. JSP - AJAX problem
    By MaheshReddy in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 09-27-2009, 01:54 AM

Posting Permissions

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