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.
Page 2 of 2 FirstFirst 12
Results 16 to 24 of 24
  1. #16
    Regular Coder
    Join Date
    Nov 2010
    Location
    Washington DC
    Posts
    338
    Thanks
    22
    Thanked 1 Time in 1 Post
    venegal, thanks for the post. OK!

    I would like to either post my entire code or provide a link, but two issues.

    1.) the entire code is about 900 lines --which I think would deter others because of the lenght.
    2.) the project I'm working on is for a local intranet network; therefore I cannot post a link publicly. If there is a private platform on which I can post the link, I'll be glad to do so.

    Starting from my intended goal --though maybe considered "illogical", it is the best option I'm prevy too at the moment.

    On the current page, a client LookUP form is populated by an ajax code. This code takes its initial value from an input box on the form "clientID". This is the code:
    PHP Code:
    var ajax = new sack();
        var 
    currentClientID=false;
        function 
    getClientData()
        {
            var 
    clientId document.getElementById('clientID').value.replace(/[^0-9|a-z|A-Z]/g,'');//here to incorporate the client id with numbers and letters
            
    if(clientId.length >&& clientId!=currentClientID){//here to change the client id lenght
                
    currentClientID clientId
                
                ajax
    .requestFile 'getClient.php?getClientId='+clientId;    
                
    ajax.onCompletion showClientData;    
                
    ajax.runAJAX();                
                    
            }
            
        }
        
        function 
    showClientData()
        {
            var 
    formObj document.forms['clientForm'];    
            eval(
    ajax.response);
                }
        
        
        function 
    initFormEvents()
        {
            
    document.getElementById('clientID').onblur = function(){getClientData();
    }
            
    document.getElementById('clientID').focus();
            } 
    Now this ajax has a companion external php file which processes and retrieves necessary form fields and returns the values back to the form. this is the php:
    PHP Code:
      $res mysql_query("select * from additional_cars where clientID='".$_GET['getClientId']."'") or die(mysql_error());
        if(
    $inf mysql_fetch_array($res)){
        echo 
    "formObj.firstname.value = '".toSafeString($inf["firstname"])."';\n";    
        echo 
    "formObj.lastname.value = '".toSafeString($inf["lastname"])."';\n"
        echo 
    "formObj.lastname1.value = '".toSafeString($inf["lastname"])."';\n";    
        echo 
    "formObj.address.value = '".toSafeString($inf["address"])."';\n";    
        echo 
    "formObj.zipcode.value = '".toSafeString($inf["zipcode"])."';\n";    
        echo 
    "formObj.city.value = '".toSafeString($inf["city"])."';\n";    
        echo 
    "formObj.state.value = '".toSafeString($inf["state"])."';\n";
        echo 
    "formObj.dhtmlgoodies_category.value = '".toSafeString($inf["dhtmlgoodies_category"])."';\n";
        echo 
    "formObj.dhtmlgoodies_subcategory.value = '".toSafeString($inf["dhtmlgoodies_subcategory"])."';\n";
        echo 
    "formObj.caryear.value = '".toSafeString($inf["caryear"])."';\n";
        echo 
    "formObj.servicedesc.value = '".toSafeString($inf["servicedesc"])."';\n"
        echo 
    "formObj.currentmileage.value = '".toSafeString($inf["currentmileage"])."';\n";
        echo 
    "formObj.servicearea.value = '".toSafeString($inf["servicearea"])."';\n";
        echo 
    "formObj.drivenmileage.value = '".toSafeString($inf["drivenmileage"])."';\n"
        echo 
    "formObj.clientid.value = '".toSafeString($inf["clientID"])."';\n"
        echo 
    "formObj.clientid2.value = '".toSafeString($inf["clientID"])."';\n"
        echo 
    "formObj.clientid3.value = '".toSafeString($inf["clientID"])."';\n"
        echo 
    "formObj.displayname.value = '".toSafeString($inf["lastname"]).",".toSafeString($inf["firstname"])."';\n"


      }
      else
      {
        echo 
    "formObj.firstname.value = '';\n";    
        echo 
    "formObj.lastname.value = '';\n";    
        echo 
    "formObj.lastname1.value = '';\n";    
        echo 
    "formObj.address.value = '';\n";    
        echo 
    "formObj.zipcode.value = '';\n";    
        echo 
    "formObj.city.value = '';\n";    
        echo 
    "formObj.state.value = '';\n";
        echo 
    "formObj.dhtmlgoodies_category.value = '';\n";
        echo 
    "formObj.dhtmlgoodies_subcategory.value = '';\n";
        echo 
    "formObj.caryear.value = '';\n";
        echo 
    "formObj.servicedesc.value = '';\n";
        echo 
    "formObj.currentmileage.value = '';\n";
        echo 
    "formObj.servicearea.value = '';\n";
        echo 
    "formObj.drivenmileage.value = '';\n";
        echo 
    "formObj.clientid.value = '';\n";
        echo 
    "formObj.clientid2.value = '';\n";
        echo 
    "formObj.clientid3.value = '';\n";
        echo 
    "formObj.displayname.value = '';\n";
            }    


    Now on the form, the values are not displayed as variables($), instead they are displayed as formObj value (ie: clientid).

    This is where my problem begins; whereas, I want to pass the clientid as a variable to a page outside of the current thru url (ie: insertclientinfonew.php?clientid=$clientid"). But cannot do this because clientid in the current page is not a variable.

    So, in my somewhat novice coder mind, I thought that if I created a php code within the same page and using ajax, pass the clientid to this code and then from there, create a variable of clientid. As you noted strongly, this seem illogical; and to some respect it is!

    This is why I have come to this forum in hopes of learning from the great wisdom here!

    So, if there is a simpler way to achieve this goal, based on my explanation here, please advise...

    Best,
    Mossa
    Last edited by mbarandao; 02-19-2011 at 06:30 AM.

  2. #17
    Senior Coder djm0219's Avatar
    Join Date
    Aug 2003
    Location
    Wake Forest, North Carolina
    Posts
    1,285
    Thanks
    4
    Thanked 201 Times in 198 Posts
    Ajax is used to call some script on the server whether it be the same one or a different one. In your case a separate one that accept the clientid and returns it would seem to be the best choice. There's nothing stopping you from putting everything in one script but you'll find that it is easier to have a separate one (especially based on what you've described so far).
    Dave .... HostMonster for all of your hosting needs

  3. #18
    Gütkodierer
    Join Date
    Apr 2009
    Posts
    2,127
    Thanks
    1
    Thanked 426 Times in 424 Posts
    Ok, I guess I'm starting to understand what this is about. You have a variable in your PHP script, and you want to access that with Javascript.

    If that's indeed what you want to do, you can either make PHP write out the necessary Javascript to define a Javascript variable with the value of the PHP variable in the first place, like
    Code:
    <script type="text/javascript">
    var myVar = <?php echo json_encode($myVar) ?>;
    </script>
    or you could make an ajax call for that information, and let the responsible PHP script return JSON, which you can then parse with Javascript in order to get the data into a Javascript object.

  4. #19
    Regular Coder
    Join Date
    Nov 2010
    Location
    Washington DC
    Posts
    338
    Thanks
    22
    Thanked 1 Time in 1 Post
    ... a bit of relief! We are somehow getting on the same page.
    Just to clarify, I have a value (clientid) which is not a variable in the form, I'm trying to pass it to php as a variable.

    The thing is that the form does not have a submit button --because it receives values from db in the manner mentioned in my detailed explanation.

    I do not believe I can grab clientid as $clientid directly from the first php --which passes the variables to the form via ajax into my second php script that is on the same page as the form. I may be wrong; however, I trust to stand corrected, because this would resolve my issue!

    Is this your understanding of my issue that predicates your suggestion in the last post? if so, I'll attempt that suggestion!

    Mossa
    Last edited by mbarandao; 02-18-2011 at 07:40 PM.

  5. #20
    Gütkodierer
    Join Date
    Apr 2009
    Posts
    2,127
    Thanks
    1
    Thanked 426 Times in 424 Posts
    Ok, so the actual premise is that you have some value in some form input, and you need to access that with Javascript in order to pass it to a PHP script.

    I don't know how your HTML looks like, but if, for example, it looks like this:
    Code:
    <form name="myForm">
    <input type="text" name="clientID" value="something" />
    </form>
    you can access the actual value of the input in your Javascript like this:
    PHP Code:
    var clientID document.myForm.clientID.value

  6. #21
    Regular Coder
    Join Date
    Nov 2010
    Location
    Washington DC
    Posts
    338
    Thanks
    22
    Thanked 1 Time in 1 Post
    Thanks for the follow-up.

    But I still believe my problem remains; for how do I get the variable --once I have it as js var, to the php code in the same page?

  7. #22
    Gütkodierer
    Join Date
    Apr 2009
    Posts
    2,127
    Thanks
    1
    Thanked 426 Times in 424 Posts
    Well, I suppose I just don't understand you. "The php code in the same page" doesn't really make sense — there is no PHP in the page. As soon as you can speak of a "page", that is, as soon as PHP has finished its job and the generated page hits the browser, there is no PHP any more. The PHP process has died. Whatever you do then to talk to your server, it will always spawn a completely new PHP process that has nothing to do with the previous request. If you have somehow built your application around the idea that your browser can continuously talk to the same PHP process, this will never work.

    Maybe I misunderstand what you are saying, and if so, I'm sorry, but even after your explanations I just don't understand the intended process flow at all.

    Maybe someone else, who better understands what you're after, can chip in.

  8. #23
    Regular Coder
    Join Date
    Nov 2010
    Location
    Washington DC
    Posts
    338
    Thanks
    22
    Thanked 1 Time in 1 Post
    Cool! Let me give it another shot...

    The page with the form values is called client_information.php. Inside this page I have this :
    PHP Code:
    <form name="clientForm" action="client_information.php" method="post">    <!--ajax-client_lookup.html-->

    <!--<
    input type="text" id="clientid" onkeyup="showHint(this.value)" />-->
    <!--<
    input type="hidden" style=background:transparentborder:0pxname='clientid' >-->
        <
    fieldset style="width: 1090; height: 470">
            <
    legend align="left"><b><font size="4" color="#FF0000">Client information</font></b></legend>
            
            <
    div style=  "position: absolute;  width: 140px; height: 140px; z-index: 3; left: 430px; top: 230px; background-transparent:;  bottom:-7" id="layer3"><!--width 140 height 140-->
        <
    DIV style="border-style: inset;" "position: absolute; width: 104px; height: 100px; left: 4px; top: -15px" id="image" ><span id="txtHint" title="Client Vehicle"style="color:#BEBEBE" ></span></DIV>
        <!--<
    span id="txtHint"></span>-->
        <!--<
    image src='' border="1"  width="104" height="100" name="uploadedfile"-->
        
    &
    nbsp;</div>

            <
    table width="1100">
                <
    tr>
                    <
    td>License Plate Number:</td>
                    <
    td>
                    <
    input name="clientID" id="clientID" size="17" maxlength="16"  style="background-color: #00FFFF" value="License Plate#" onkeyup="showHint(this.value)"> &nbsp;&nbsp;<!--for car image display-->
                    <
    div id="hidden" style="color:#BEBEBE" ><input type="text"  id="clientid" name="clientid"  size="17" onblur="showResult(this.value)"></div><!--for balance display onblur="showResult(this.value)"oninput="OnInput(event)" onpropertychange="OnPropChanged()" value=""onblur="showResult(this.value)" -->
                    <
    div id="hidden2" style="color:#BEBEBE" ><input type="text" name="clientid2" id="clientid2" size="17" ></div><!--for Oil Change Date display onkeyup="showResult2(this.value)";-->
                    <
    div id="hidden3" style="color:#BEBEBE" ><input type="text"  name="clientid3" id="clientid3" size="17"  onblur="showResult3(this.value)"></div><!--for passing the variable onkeyup="showResult3(this.value)"-->
                    <
    div id="blankbox" style="color:#FF0000" ></div><!--<input style="color:#FF0000"type="text" name="none" id="none" size="17" >-->
                    <!--<
    input type="text" name="returnedClientId" id="returnedClientId">-->
    <!--<
    input type="button" onclick="locationPathname();" value="get Location Pathname" />-->


    <
    class="button" href='#'><span>CLICK TO SEARCH</span></a>
    </
    b></td>
                    <
    td>
                    <
    p align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    </
    p>
                    <
    div style="position: absolute; width: 519px; height: 455px; z-index: 1; left: 610px; top: 192px; background-color:#FFFFFF" id="layer1">

                        <
    table border="0" width="100%" height="372">
                            <
    td width="50" height="25" valign="top" bgcolor="#000000" align="center"><font size="5" color=#FFFFFF>Vehicle Details<hr color="#FFFFFF" size="1"></td>
                            
    <tr>
                                <
    td height="26">
                                <!--<
    p align="center"><font size="4">Vehicle Details<hr color="#C0C0C0" size="1">-->
                                </
    font></td>
                            </
    tr>
                            <
    tr>
                            <
    td VALIGN="top" width="1%" style="border-left: 0px dotted" color="#CCCCCC;">
                            <
    div id='separating-line'></div>

                            <!--<
    p align="right"><label for="theDate">Customer Since:</label>
                            <
    input type="text" name="theDate" size="20" style="padding: 0" disabled="true"></p>-->
                            <
    p align="left">
                            <
    label for="dhtmlgoodies_category">Make:</label>
                            <
    input type="text" name="dhtmlgoodies_category" id="dhtmlgoodies_category" size="14" style="padding: 0" disabled="true"
                            <
    label for="dhtmlgoodies_subcategory">Model:</label
                            <
    input type="text" name="dhtmlgoodies_subcategory" size="25" style="padding: 0" disabled="true"
                            &
    nbsp;&nbsp;&nbsp;<label for="caryear">Year:</label>
                            &
    nbsp;<input type="text" name="caryear" size="5" style="padding: 0" disabled="true"></p>
                            <
    label for="currentmileage">Last Recorded Mileage:</label>
                            <
    input type="text" name="currentmileage" id="currentmileage" size="20" disabled="true"><br><p>
                            
                            <
    label for="servicearea">Last Service Rendered:</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            &
    nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<label for="drivenmileage">Driven Miles 
                            
    </label>
                            <
    textarea name="servicearea" id="servicearea" cols=40 rows=2 style="padding: 0" disabled="true"></textarea><!--<label for="drivenmileage">Driven Miles 
                            between the last two visits
    :</label>-->
                            <
    textarea name="drivenmileage" id="drivenmileage" cols=10 rows=2 style="padding: 0" disabled="true"></textarea>
                            <!--<
    input type="text" name="drivenmileage" id="drivenmileage" size="5" disabled="true">--><br>
                            
                            <
    label for="servicedesc">Service History:</label>
                            &
    nbsp;    
                            <!--<
    div id="servicedesc" name="servicedesc"></div>    -->
                            <!--<
    textarea name="servicedesc" id="servicedesc" cols=60 rows=12 disabled="true" style="position: absolute; right: 13; top: 260"></textarea></td>-->
                            <
    textarea name="servicedesc" id="servicedesc" cols=60 rows=12 disabled="true" style="position: absolute; right: 13; top: 260"></textarea></td>
                                                                            </
    tr>
                        </
    table>
                        
                    </
    div>
                                    </
    td>
                </
    tr>
                            
                        
                <
    tr>
                    <
    td><label for="firstname">First name:</label></td>
                    <
    td>
                    <
    input name="firstname" id="firstname" size="20" maxlength="255" disabled="true"></td>
                    <
    td>
                    &
    nbsp;</td>
                </
    tr>
                        
                <
    tr>
                    <
    td><label for="lastname">Last name:</label></td>
                    <
    td>
                    <
    input name="lastname" id="lastname" size="20" maxlength="255" disabled="true"></td>
                <
    input type="hidden" name="displayname" id="displayname" size="20" maxlength="255" onBlur="document.displayinfo.displayvalue.value=document.clientForm.displayname.value">
                <
    input type="hidden" name="lastname1" id="lastname1" size="20" maxlength="255" onBlur="document.displayinfo.lastnamevalue.value=document.clientForm.lastname1.value"></td>
                
                                <
    td>
                    &
    nbsp;</td>
                </
    tr>
                <
    tr>
                    <
    td><label for="address">Address:</label></td>
                    <
    td>
                    <
    input name="address" id="address" size="20" maxlength="255" disabled="true"></td>
                    <
    td>
                    &
    nbsp;</td>
                </
    tr>
                <
    tr>
                    <
    td><label for="zipcode">Zip code:</label></td>
                    <
    td><input name="zipcode" id="zipcode" size="8" maxlength="5" disabled="true"></td>
                    <
    td>&nbsp;</td>
                </
    tr>
                <
    tr>
                    <
    td><label for="city">City:</label></td>
                    <
    td><input name="city" id="city" size="20" maxlength="255" disabled="true"></td>
                    <
    td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </td>
                </
    tr>
                <
    tr>
                    <
    td><label for="state">State:</label></td>
                    <
    td>
                    <
    input name="state" id="state" size="20" maxlength="255" disabled="true"></td>
                    <
    td>
                    &
    nbsp;</td>
                </
    tr>
                <
    tr>
                    <
    td><label for="tel_number">Phone #:</label></td>
                    
    <td>
                    <
    input name="areacode" id="areacode" size="3" maxlength="3" disabled="true">-<input name="phoneprefix" id="phoneprefix" size="3" maxlength="3" disabled="true">-<input name="phonesufix" id="phonesufix" size="4" maxlength="4" disabled="true"></td>
                                </
    tr>

                <
    tr>
                    <
    td><label for="email">Email:</label></td>
                    <
    td>
                    <
    input name="email" id="email" size="42" maxlength="25" disabled="true"></td>
                    <
    td>
                    &
    nbsp;</td>
                </
    tr>
                <
    tr>
                    <
    td><label for="cell_number">AltPhone#:</label></td>
                    
    <td>
                    <
    input name="cellareacode" id="cellareacode" size="3" maxlength="3" disabled="true">-<input name="cellprefix" id="cellprefix" size="3" maxlength="3" disabled="true">-<input name="cellsufix" id="cellsufix" size="4" maxlength="4" disabled="true"></td>
                    <
    td>&nbsp;</td>
                </
    tr>
                <
    tr>
                    <
    td><label for="commentonclient">Special Comment on Client:</label></td>
                    <
    td>
                    <
    p align="left">
                    <
    textarea name="commentonclient" id="commentonclient" cols=36 rows=6 disabled="true"></textarea>
            </
    tr>
                    <
    td>
                    &
    nbsp;</tr>
            </
    table>
                  <
    div id="livesearch2" ></div><!--div for oil change-->
                <
    div id="baldue" >Balance On Account</div><!--Label div for balance due-->
                <
    div id="livesearch" ></div><!--div for balance due  style="filter:alpha(opacity=100); opacity:0.5;">-->
                <
    div id="oilchangedate" Next Oil Change Reminder</div><!--Label div for oil change-->
                <
    a id="emailicon" title="Notify Client via Text or Email Concerning an Oil Change" onmouseover="this.style.cursor='pointer'" onfocus='this.blur();' onclick="document.getElementById('PopUp11').style.display = 'block' "></a>
                <
    div id="PopUp11" style="display: none; position: absolute; height: 400px; left: 0px; top: 150px; border: solid black 1px; padding: 10px; background-color: rgb(255,255,225);  text-align: justify; font-size: 12px; width: 410px;">
                <
    iframe id="mate" frameborder=0 scrolling=yes width=100%  src='sms\\notifyClient.htm' height="790"  align="left"></iframe><br />
                <
    div valign="top" style='text-align: right; display: inline; position: absolute; left: 10px; top: 10px;'><a onmouseover='this.style.cursor="pointer" ' style='font-size: 12px;' onfocus='this.blur();' onclick="document.getElementById('PopUp11').style.display = 'none' " ><span valign='left' style="text-decoration: underline;" >Close Window!</span></a>
                </
    div></div>
                <
    div id="passingvar" ></div><!--Label div passing var to process client-->
                <
    div id="livesearch3" ></div><!--div passing var to process client-->


                <!--<
    div id="BalDue">Balance Due is:<span id="displayHint" style="color:#BEBEBE" ></span></div>    -->

        </
    form
    which constitute my form and is populated dynamically with one of my ajax.

    Now with this same page (client_information.php) I have this php code:
    PHP Code:
    <?php
            
    error_reporting
    (0);
    error_reporting(E_ERROR E_WARNING E_PARSE);
    include 
    'datalogin.php';

    //this query pulls all client id from ajax and makes it available for ajax hint to compare with what is being inputed on the form
    $result mysql_query("SELECT clientID, customerid FROM additional_cars");
    while(
    $row=mysql_fetch_array($result)) {
         
    $clientID=$row["clientID"];
         
    $a[]= "$clientID";
        
    //echo "client id is $clientID";

    }
    //get the q parameter f
    $q=$_GET["q"];
    echo 
    "q is $q";

    //lookup all hints from array if length of q>0
    if (strlen($q) > 0)
      {
      
    $hint="";
      for(
    $i=0$i<count($a); $i++)
        {
        if (
    strtolower($q)==strtolower(substr($a[$i],0,strlen($q))))
          {
          if (
    $hint=="")
            {
            
    $hint=$a[$i];
            }
          else
            {
            
    $hint=$hint." , ".$a[$i];
            }
          }
        }
      }

    // Set output to "no suggestion" if no hint were found
    // or to the correct values
    if ($hint == "")
      {
     
    //$response="no suggestion";
      
    }
    else
      {
      
    $response=$hint;
      }

    //output the response
    //echo" id is $response";
    $trimmed trim($response); //trim whitespace from the stored variable

    $get_swork2 "select * from additional_cars where clientID='$trimmed'";// order by id desc limit 1";//here we are pulling dat from services where the license plate is $clientID, we use this to display last service(s) rendered
     
    $get_swork2_res mysql_query($get_swork2); 

      if (
    mysql_num_rows($get_swork2_res) > 0
      { 
         while ( 
    $swork2_info mysql_fetch_array($get_swork2_res)) 
        { 
           
    $firstname $swork2_info['firstname']; 
           
    $lastname $swork2_info['lastname']; 
           
    $comma=", ";
           
    $sel_id="$lastname$comma$firstname";

                            }
                }
        
    ?>
    Now this php code is intended to provide certain variables, that I can append to a link that is going from this very page. this is the link:
    PHP Code:
    <a href="addentrynew_passed.php?sel_id=<?php echo $sel_id?>&lastname=<?php echo $lastname?>">PROCESS CLIENT</a>
    A bit long, but I have no other way to convey this issue. I apologize for any redundancy...

    Mossa
    Last edited by mbarandao; 02-19-2011 at 06:32 AM.

  9. #24
    Regular Coder
    Join Date
    Nov 2010
    Location
    Washington DC
    Posts
    338
    Thanks
    22
    Thanked 1 Time in 1 Post
    Issue resolved!

    Final solution...

    Instead of trying to pass the variable within the main page (I'm calling "client_info.php) using the window.location object, I used xmlhttp.open("GET", url) and made the ajax call to the initial code I had within "client_info.php", but as an external file (and called getVariables.php). This obviously was simple and is how --I suppose, xmlhttp.open() is intended to be used. The challenge in my case was that I needed to return certain variables back to the sending page and appended those variables to a button; to therefore onclick of this button, will pass those variables in a url to the proceeding page.

    Solution: I removed those links from the initial page (client_info.php) and recreated them in the ajax companion php page (getVariables.php). Using css within this page, I positioned these links inside a div with the same percise x and y cordinates to replace the initial links on the main page (client_info.php). So now, when the client's information has been retrieved and displayed on client_info.php, another ajax (function showResult()) makes a call to getVariables.php and returns the links back to the main page with the appropriate variables. Now, if clicked, the variables of that particular client are passed. That has been the goal!


    Thanks for all of the thoughts on this task!
    Mossa


 
Page 2 of 2 FirstFirst 12

Posting Permissions

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