I am still trying to write a form that submits with dynamic images instead of submit buttons. These are PHP images.
I think I have discovered some major design flaws in the input statement for type="image" You cannot get it to submit data directly.
I have at least 4 of the best books on
Javascript and *none* describe how to do this -- as simple as it ought to
be. I have this down to one line.
This works! But it is a type="submit" (the onClick part is just
ignored) -- it shows a series of buttons with labels
<?php do { ?>
<td>
<input name="ProductID" type="submit" value=http://www.webdeveloper.com/forum/archive/index.php/"<?php echo
$row_rsProducts['ProdID']; ?>" src=http://www.webdeveloper.com/forum/archive/index.php/"<?php echo $row_rsProducts['ImgSrc'];
?>" alt="<?php echo $row_rsProducts['Prod_Desc']; ?>" onClick=
"submitForm( this.form )" >
</td>
This does *not* work. This only change is the type="image" with an onclick=
submitForm. But it shows all the graphic images
<?php do { ?>
<td>
<input name="ProductID" type="image" value=http://www.webdeveloper.com/forum/archive/index.php/"<?php echo
$row_rsProducts['ProdID']; ?>" src=http://www.webdeveloper.com/forum/archive/index.php/"<?php echo $row_rsProducts['ImgSrc'];
?>" alt="<?php echo $row_rsProducts['Prod_Desc']; ?>" onClick=
"submitForm( this.form )" >
</td>
the small function call is:
function submitForm( form ) {
alert( form );
document.ProductID.submit( form );
I think I have discovered some major design flaws in the input statement for type="image" You cannot get it to submit data directly.
I have at least 4 of the best books on
Javascript and *none* describe how to do this -- as simple as it ought to
be. I have this down to one line.
This works! But it is a type="submit" (the onClick part is just
ignored) -- it shows a series of buttons with labels
<?php do { ?>
<td>
<input name="ProductID" type="submit" value=http://www.webdeveloper.com/forum/archive/index.php/"<?php echo
$row_rsProducts['ProdID']; ?>" src=http://www.webdeveloper.com/forum/archive/index.php/"<?php echo $row_rsProducts['ImgSrc'];
?>" alt="<?php echo $row_rsProducts['Prod_Desc']; ?>" onClick=
"submitForm( this.form )" >
</td>
This does *not* work. This only change is the type="image" with an onclick=
submitForm. But it shows all the graphic images
<?php do { ?>
<td>
<input name="ProductID" type="image" value=http://www.webdeveloper.com/forum/archive/index.php/"<?php echo
$row_rsProducts['ProdID']; ?>" src=http://www.webdeveloper.com/forum/archive/index.php/"<?php echo $row_rsProducts['ImgSrc'];
?>" alt="<?php echo $row_rsProducts['Prod_Desc']; ?>" onClick=
"submitForm( this.form )" >
</td>
the small function call is:
function submitForm( form ) {
alert( form );
document.ProductID.submit( form );