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 8 of 8

Thread: help me here

  1. #1
    New to the CF scene
    Join Date
    May 2008
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    help me here

    There have three files and I have also requested a list when selecting the value of the list must be other values in the print files required Example
    PHP Code:
    <select name="FileNO" onChange="change_pationt(this.value);">
                <? 
     
    $query
    ="SELECT * FROM pationt";
    $result=mysql_query($query) or die("error: " mysql_error());
    while(
    $row=mysql_fetch_array($result))
    {
        echo 
    "???";
    ?>  
    <option value="<?php echo $row['PationtName'] ; ?>"><?php echo $row['PNO'] ; ?></option>   
    <?

        
    }  
    ?>
              </select>


    <input name="PationtName" type="text" id="PationtName"/>

    <input name="address" type="text" id="address"/>

    <input name="tell" type="text" id="address"/>
    when i select from list value , we must print on each filetext value of it >>>who

    i can solveed by using java script but it print only for pationtname ???

    PHP Code:
    function change_doctor(ref

         
    document.getElementById('DocName').value  ref


  • #2
    Senior Coder shyam's Avatar
    Join Date
    Jul 2005
    Posts
    1,563
    Thanks
    2
    Thanked 163 Times in 160 Posts
    I assume the values of address and tell are also present in the pationt table...the simplest way to do it is to have a some sort of delimited string for the value

    PHP Code:
    <select name="FileNO" onChange="change_pationt(this.value);">
                <? 
     
    $query
    ="SELECT * FROM pationt";
    $result=mysql_query($query) or die("error: " mysql_error());
    while(
    $row=mysql_fetch_array($result))
    {
    ?>  
    <option value="<?php echo $row['PationtName'] . '^' $row['address'] . '^' $row['tell']; ?>"><?php echo $row['PNO'] ; ?></option>   
    <?

        
    }  
    ?>
    </select>
    <input name="PationtName" type="text" id="PationtName"/>

    <input name="address" type="text" id="address"/>

    <input name="tell" type="text" id="tell"/>
    and use

    Code:
    function change_doctor(ref) {
      var arr = ref.split(/^/);
      document.getElementById('PationtName').value  = arr[0]; 
      document.getElementById('address').value  = arr[1];
      document.getElementById('tell').value  = arr[2];
    }
    You never have to change anything you got up in the middle of the night to write. -- Saul Bellow

  • #3
    New to the CF scene
    Join Date
    May 2008
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    there are wrong !!
    when i insert by using above code i go to Data Base and the ther are wrong sort ??

  • #4
    Senior Coder shyam's Avatar
    Join Date
    Jul 2005
    Posts
    1,563
    Thanks
    2
    Thanked 163 Times in 160 Posts
    oops...thats gotta be

    Code:
    var arr = ref.split(/\^/);
    You never have to change anything you got up in the middle of the night to write. -- Saul Bellow

  • #5
    New to the CF scene
    Join Date
    May 2008
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ok
    but on data base we print on parentname and address and tell value of pationtname this is wrong

  • #6
    New to the CF scene
    Join Date
    May 2008
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    what can i do

  • #7
    New to the CF scene
    Join Date
    May 2008
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    what >>>>

  • #8
    New to the CF scene
    Join Date
    May 2008
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ???

    what >>>>


  •  

    Posting Permissions

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