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 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Aug 2006
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question can i stop a page reloading when i send form data.

    i am working on a slideshow page that has 2 frames a top which is the photo viewer and the bottom which is the filmstrip.
    Every time i post the data to the top frame the bottom frame reloads and has to start the picture loading process again..
    Any ideas how to fix it.

    BTW the top frame is a .php file and the bottom is a .html

    thanks for any help

  • #2
    Regular Coder mic2100's Avatar
    Join Date
    Feb 2006
    Location
    Scunthorpe
    Posts
    562
    Thanks
    15
    Thanked 28 Times in 27 Posts
    on which page is the submit button???

  • #3
    New to the CF scene
    Join Date
    Aug 2006
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    the submitt button is on the bottom frame/page. so when i click on the images it sends the information to the picture viewer (topframe.php).

    I'm not sure but i think the fact that the image filmstrip is loaded with document.write() does something.

    Code:
    function loadall(){
    	
    	var no = parent.TopFrame.document.all[parent.TopFrame.document.all['numbapics'].value].value;
    	var i;
    	var whatdir = parent.TopFrame.document.all['hidval'].value;
    	var thumblocation = "http://www.fileden.com/files/2006/8/25/185124/Photos" + whatdir + "photo";
    	var picslocation = "http://www.fileden.com/files/2006/8/25/185124/Photos" + whatdir + "photo";
    
    
    
    for (i = 1; i < no; ++ i) {
    		
    	status = "Developing film....";
    	document.write("<td align=center valign=middle><input type=image name='picsel" + i + "' src=" + thumblocation + "&#32;&#40;" + i + "&#41;.jpg" + " alt='" + picslocation + "&#32;&#40;" + i + "&#41;.jpg'" + " onmouseover='changeOp(this)' onmouseout='changeOpback(this)' onclick='changeimage(this.alt)'  width='75' height='56' ><br></td>" );
    	
    
    
    }

  • #4
    New to the CF scene
    Join Date
    Aug 2006
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Angry Any help would be kickass to say the least

    I even removed the form alltogether and made an onclick command that instead of submitting form data
    used the parent.TopFrame.window.location = "http:/balh.php?setname=blan&so-on=blah....
    you get the picture.

    so presumably the top frame should load the form data and the bottom frame should go about its merry way loading the rest of the images... But NO!

    i've spent 4hrs on this already damn crappy browser...

    I bet its something simple.

    heres the entire 2 pages. code and all

    PHP Code:

    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <meta name="generator" content="">
    <title>Photo Gallery</title>
    <link href="cool" rel="stylesheet" type="text/css">
    </head>
    <style type="text/css">

    body { background: #000000 url(./worms.jpg) no-repeat bottom left; scrollbar-face-color: #FFFFFF; scrollbar-shadow-color: #000000; scrollbar-highlight-color: #000000; scrollbar-3dlight-color: #FFFFFF; scrollbar-darkshadow-color: #000000; scrollbar-track-color: #000000; scrollbar-arrow-color: #000000}
    .matrix { color:#FFFFFF; font-family:Tahoma; font-size:10pt; text-align:center; width:10px; padding:0px; margin:0px;}
    </style>
    <script language="JavaScript1.2">

    function setdirname(dnames,dindex){

        document.all ['hidval'].value = dnames;
        document.all ['numbapics'].value = "n" + dindex;
        status= "n" + dindex;
        parent.BottomFrame.location.reload();
        



    }

    </script>
    <body bgcolor="#000000" text="#FFFFFF" link="white" vlink="#b8860b" alink="#ffd700" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"  >

      <input name="n0" type="hidden" id="n0" value="7" >
      <input name="n1" type="hidden" id="n1" value="32" >
      <input name="n2" type="hidden" id="n2" value="9" >
      <input name="n3" type="hidden" id="n3" value="116" >
      <input name="n4" type="hidden" id="n4" value="19" >
      <input name="n5" type="hidden" id="n5" value="59" >
      <input name="n6" type="hidden" id="n6" value="200" >

    <div align="center"> 
      <?php 
    $mytival 
    "";
        
                if(isset(
    $_POST['action']) && $_POST['action'] == "attachme") {
                
                
    $mytival "$comdesc";
                
    $stsearch "$imname";
                
    $list = array();
                
    $listy = array("$stsearch,$mytival");                        
                                                    
                            
                            
    $row 0;
    $done false;
    $fp fopen("commentstore.csv"'r+t');
    while ((
    $data fgetcsv($fp,4096",")) !== FALSE) {
       
    $num count($data);
       
    $list[$row] = $data;
       for (
    $c=0$c $num$c++) {
           
    $settext $data[$c];
         
          if (
    $settext == $stsearch){
                   
    $list[$row] = split(",",$listy[0]);
                  
    $done true;            
                }                            
            
       }
       
       
    $row++;
    }
    $row 0;
    fclose($fp);
    $fp fopen("commentstore.csv"'wt');
    for(
    $x=0;$x<sizeof($list);$x++) {

        
    fputcsv($fp,$list[$x]);
    }
    if (
    $done == false){
        
    fclose($fp);
        
    $fp fopen("commentstore.csv"'at');
        foreach (
    $listy as $line) {
      
    fputcsv($fpsplit(","$line));
      }
      }
        
    fclose($fp);
                            
                    
        }                                        
                        
                        
                        
                        
                    
        
        
    ?>
        
        
      <table  width="100%" height="100%" border="0" cellpadding="4" cellspacing="0" >
        <tr height="35"  > </tr>
        <td height="35" align="center" valign="top"><font size="5" face="Georgia, Times New Roman, Times, serif"><em>The 
          Digital Photo Lab</em></font><br> <form name="nav" method="post" action="ThumbnailFrame.php" target="BottomFrame">
            <font face="Arial, Helvetica, sans-serif">Choose a Gallery</font><br>
            <select name="whatdir" class="txtboxs" id="whatdir" onChange="setdirname(document.nav.whatdir.options[document.nav.whatdir.selectedIndex].value,document.nav.whatdir.selectedIndex)"">
              <option value="/Home/">Home Photos</option>
              <option value="/Drums/">Drum Pics</option>
              <option value="/Friends/">Our Friends</option>
              <option value="/Goingout/">Going Out</option>
              <option value="/Family/">Family</option>
              <option value="/Animals/">Animals-Surfing</option>
              <option value="/Holidays/">Holidays</option>
            </select>
            
            <input name="numbapics" type="hidden" id="numbapics" value="<?php if(isset($wnumba)){print $wnumba;} else { print "n0";}?>">
              <input name="hidval" type="hidden" id="hidval" value="<?php if(isset($dirname)){print $dirname;} else { print "/Home/";}?>">
            <input name="setnumba" type="hidden" value="">
            
            
          </form></td>
        <td height="12" rowspan="2" align="center" valign="middle"><font size="1" face="Arial" color="#FFFFFF">&nbsp;</font> 
          <div align="center"><br>
            <table width="350" border="1" cellpadding="2" cellspacing="1" bordercolor="#FFFFFF" >
              <tr> 
                <td height="20" align="center" bgcolor="#FFFFFF" id=cment><font face="Arial, Helvetica, sans-serif" size="1" color="#000000">
                
                <?php 
                
    if(isset($wicpic)) { $stsearch $wicpic;}
                if(isset(
    $imname)) { $stsearch $imname;}
    if(isset(
    $stsearch)){                
    $row 0;
    $done false;
    $turks fopen("commentstore.csv"'rt');
    while ((
    $newdata fgetcsv($turks4096,",")) !== FALSE) {
       
    $num count($newdata);
       for (
    $c=0$c $num$c++) {
           
    $settext $newdata[$c];
         
          if (
    $settext == $stsearch){
                  
    $c++;
                   print 
    $newdata[$c];
                
    $glodesc $newdata[$c];
                  
    fclose($turks);
                
    $done true;            
                break;            
                }                            
            
       }
       
       
    $row++;
    }
    if(
    $done == false){
    print 
    "Description not found";
    fclose($turks);
     }
                
                }

                
                
                 
    ?>
                
                
                
                </font></td>
              </tr>
              <tr> 
                <td height="263" align="center" bgcolor="" ><input name="lrgPhoto" type="image"    onFocus="parent.BottomFrame.remit()" src="<?php if(isset($wicpic)) {print "$wicpic";} if(isset($imname)){print"$imname";} ?>" alt="" width="350" height="263"> 
                </td>
              </tr>
              <tr> 
                <td height="24" align="center" valign="top" bgcolor="#FFFFFF" > <form action="<?php echo $_SERVER['PHP_SELF']; ?>"  method="post" name="picsform" target="_self" >
                    <input name="action" type="hidden" value="attachme">
                    <input name="atdesc" type="submit" class="buttons" id="atdesc" value="Attach Description">
                    <input type="hidden" name="imname" id="imname" value="<?php if(isset($wicpic)) {print "$wicpic";} if(isset($imname)){print"$imname";} ?>">
                    <br>
                    <font color="#000000" size="1" face="Arial, Helvetica, sans-serif">Type 
                    description below. Then click the button.</font><br>
                    <input name="comdesc" type="text" id="comdesc" value="" size="40" maxlength="50">
                    <input name="wnumba" type="hidden" value="<?php if(isset($wnumba)){print "$wnumba";}?>">
                    <input name="dirname" type="hidden" value="<?php if(isset($dirname)){print "$dirname";}?>">
                  </form></td>
              </tr>
            </table>
          </div></td>
        </tr>
        <tr > 
          <td width="300" align="left" valign="top"> <p align="center"><font color="#FFFFFF" face="Arial, Helvetica, sans-serif"> 
              <strong>T</strong>his site is setup to allow family and friends to view 
              our photo's. To view the pictures just select the category from the 
              drop-down box above then click the image displayed on the filmstrip. 
              You can now add a description to the file by clicking the image and 
              using the button and text area provided.<br>
              [<a href="news.php" target="_blank">latest site news</a>]</font></p>
            <p align="center"><font face="Arial, Helvetica, sans-serif" size="1" color="#FFFFFF"> 
              <script language="JavaScript"> 
    <!--
                document.write("<b>Last Updated:</b>&nbsp;" + document.lastModified + "<br>" );

            parent.BottomFrame.location.reload()

    //-->



    document.forms[1].comdesc.value = "";    
    document.forms[1].atdesc.disabled = true;
    document.forms[1].comdesc.disabled = true;

    </script>
              <br>
              site creator<br>
              <img src="creator.gif" alt="Thats me!!!" width="100" height="81" onClick="status='Dont touch me! Im copyright 2006. Info: This site took about 12 solid hours to create. Thanks to FileDen!'" onMouseOver="this.style.cursor='crosshair'"> 
              <br>
              <a href="http://www.fileden.com/" target="_blank"><img src="logo.gif" alt="All images stored here at FileDEN. 500mb Free. So check them out." width="100" height="28" border="1"></a><a href="http://www.joynic.com" target="_blank"> 
              <img border="0" src="http://imgdata.net/www.joynic.com/us_j88x31dwk_ani.gif" alt="JOYNIC. Enjoy Free Domains!"></a></font> 
            </p></td>
        </tr>
      </table>
    </div>
    </body>
    </html>
    page TopFrame ^

    page BottomFrame\/

    Code:
    <HTML>
    <HEAD>
    		<TITLE>Our Digital Pictures</TITLE>
    	
    
    </HEAD>
    <script language="JavaScript1.2">
    scrollID=0;
    hPos=0;
    hSpeed=30;
    poog=0.8;
    x=0;
    
    function getMouseXY(e) {
    x = event.clientX ;
    }
    
    
    function onWard() {
     hPos+=eval(poog);
     document.onmousemove = getMouseXY;  
      
     window.scroll(hPos,0);
     
     if (x > (document.body.clientWidth - 100)){
     	hSpeed = 1;
     	poog=5;
     	}
     else {
     	hSpeed = 30; 
     	poog=1;}
     	
     if(x < 100 ){
     	if(hPos > 0){
     	hSpeed = 1;
     	poog=-5; }}
     
     
     if (hPos >= (document.body.scrollWidth - 1000)){
     	poog=-5;
     	 hPos = (document.body.scrollWidth - 1000);
     	 backWard();
     	 return;
     	 
     	 
     	
     	}
    
    
     scrollID=setTimeout("onWard()",hSpeed);
     }
     
     function backWard() {
     hPos+=eval(poog);
     document.onmousemove = getMouseXY;  
      
     window.scroll(hPos,0);
     
     if (x > (document.body.clientWidth - 100)){
     	hSpeed = 1;
     	poog=5;
     	}
     else {
     	hSpeed = 30; 
     	poog=-1;
     	
     	}
     	
     if(x < 100 ){
     	if(hPos > 0){
     	hSpeed = 1;
     	poog=-5; }}
     
     
     if (hPos < 100){
     	poog=1;
     	 onWard();
     	 return;
     	}
     
    
     scrollID=setTimeout("backWard()",hSpeed);
     }
     
     function changeOp(id){
      id.style.cursor = 'hand';
      id.style.filter = "progid:DXImageTransform.Microsoft.BasicImage(invert=1)"
      
       
     
     }
     function changeOpback(id){
     id.style.cursor = '';
     id.style.filter = "progid:DXImageTransform.Microsoft.BasicImage(invert=0)"
      }
    
     function changeimage(imgN){
    	document.all['wicpic'].value=imgN;
    
    	status="Loading photo into viewer...";
    	var mainlocation = "";
    	var mainlocation = parent.TopFrame.location.href + "?dirname=" + document.all['dirname'].value + "&wnumba=" + document.all['wnumba'].value + "&wicpic=" + document.all['wicpic'].value + "&action=picsearch"; 
    	parent.TopFrame.location = mainlocation;	
    	parent.TopFrame.document.forms[1].atdesc.disabled = true;
        parent.TopFrame.document.forms[1].comdesc.disabled = true;			
    	
    }
    
    
    function remit(){
    	status = "Done!";
    	parent.TopFrame.document.forms[1].atdesc.disabled = false;
        parent.TopFrame.document.forms[1].comdesc.disabled = false;
    }
    </script>
    
    <BODY bgcolor="#000000" text="#00CC33" link=#ffffff vlink=#b8860b alink="#ffd700" leftmargin="20" topmargin="10" marginwidth="20" marginheight="20">
    
    <div align="center">
      
    
        
      
    
    
      <table width="100%" height="89"  border="0" cellpadding="6" cellspacing="0" background="fstrip.jpg">
        <tr valign="middle" align="center">
          
           
    	   
    	   
    	    <script language="JavaScript1.2"> 
    	\\the code that loads the filmstrip
    	function loadall(){
    	
    	var no = parent.TopFrame.document.all[parent.TopFrame.document.all['numbapics'].value].value;
    	var i;
    	var whatdir = parent.TopFrame.document.all['hidval'].value;
    	var thumblocation = "http://www.fileden.com/files/2006/8/25/185124/Photos" + whatdir + "photo";
    	var picslocation = "http://www.fileden.com/files/2006/8/25/185124/Photos" + whatdir + "photo";
    
    
    
    for (i = 1; i < no; ++ i) {
    		
    	status = "Developing film....";
    	document.write("<td align=center valign=middle><img  src=" + thumblocation + "&#32;&#40;" + i + "&#41;.jpg" + " alt='" + picslocation + "&#32;&#40;" + i + "&#41;.jpg'" + " onmouseover='changeOp(this)' onmouseout='changeOpback(this)' onclick='return changeimage(this.alt)'  width='75' height='56' ><br></td>" );
    	
    
    
    }
    document.write("<input type='hidden' name='wicpic' value=''>");
    
    
    }
    
    document.write("<input type='hidden' name='dirname' value='" + parent.TopFrame.document.all['hidval'].value + "'>");
    document.write("<input type='hidden' name='wnumba' value='" + parent.TopFrame.document.all['numbapics'].value + "'>");
    
    
    loadall();
    </script> 
            <input type="hidden" name="action" value="picsearch" >
      
        </tr>
    			</table>
    		</div>
    	</BODY>
    <script language="javascript1.2">
    if (document.images){
    
    onWard(); \\filmstrip moving code
    }
    
    status = "Film Developed.";
    </script>
    
    </HTML>


  •  

    Posting Permissions

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