Help writing a form

Discussion in 'HTML & Website Design' started by caday32, Sep 1, 2008.

  1. #1
    Ok let see if I can explain it.

    I am needing help in figuring out how to make this code work. For each image it should have the image displayed and when the user click the image the form should submit to external.php. I am just not thinking clear as I have not slept and need someone to look at the code and see if I am missing anything. Thanks
    
    $i = 1;
    foreach($arr as $val) {
    	echo '<div class="showImages">' . "\n" .
    	'<script type="text/javascript">' . "\n" .
    'function openmypage(){ ' . "\n" .
    'ajaxwin=dhtmlwindow.open("ajaxbox", "ajax", "windowfiles/external.htm", "#3: Ajax Win Title", "width=450px,height=300px,left=300px,top=100px,resize=1,scrolling=1")' . "\n" .
    'ajaxwin.onclose=function(){return window.confirm("Close window 3?")} ' . "\n" .
    '}' . "\n" .
    '</script>' . "\n" .
    
    
    
    	'<form action="external.php" method="post"><input type="text" name="showImage" class="showImageTextBox" onClick="openmypage(); return false" value="&lt;a href=&quot;' . $urlBase . '&quot;&gt;&lt;img src=&quot;' . $url2folder . 'images/' . $val . '&quot;  alt=&quot;' . $imgAlt . '&quot;&gt;&lt;/a&gt;"/><img src="' . $url2folder . 'images/' . $val .'" alt="' . $val . '" /></a>
    <input type="submit" class="showImageTextBox" value="Show Code" /></form>' . "\n" .
    	'</div>' . "\n\n";
    	$i++;
    }
    PHP:
     
    caday32, Sep 1, 2008 IP