Welcome Guest, Not a member yet? Register   Sign In
upload image in a form
#1

[eluser]santorini[/eluser]
hello,
is it possible to upload a picture (form_open_multipart), within an 'normal' input-form, including different values(date,name, email etc.).
?
All entries should be sent with only one submit button.

My picture upload works only with an additional submit-button.


Code:
//view

echo form_open() . PHP_EOL;
    echo form_fieldset() . PHP_EOL;
    echo form_error('datum') ? '<div ' . $fehler . '>' . PHP_EOL : '<div>' . PHP_EOL;
    echo form_label('Datum:*', 'datum') . PHP_EOL;
    $data = array(
        'name'        => 'datum',
        'id'          => 'datepicker',
        'class'       => 'kurz',
    );
    echo form_input($data, set_value('datum', $datum)) . PHP_EOL;
    echo '</div>';
    echo form_label('Bild hochladen:', 'bild') . PHP_EOL;
    echo form_open_multipart('redaktion/agenda/doUpload');
    echo form_upload('userfile');
    echo form_fieldset_close() . PHP_EOL;
    echo form_fieldset() . PHP_EOL;
    echo form_button('abbrechen', 'zurück', 'onClick=self.location.href="' . $back_link . '"') PHP_EOL;
    echo form_submit('submit', $submit_text, 'class="mittel"') . PHP_EOL;
    echo form_fieldset_close() . PHP_EOL;
    echo form_close() . PHP_EOL;?&gt;

&lt;!--image upload additional --&gt;
    &lt;?php
    echo form_open_multipart('redaktion/agenda/doUpload');
    echo form_upload('userfile');
    echo form_submit('submit', 'Upload');
    echo form_close();
    ?&gt;

thanks for helping me :-)


Messages In This Thread
upload image in a form - by El Forum - 07-31-2012, 10:03 AM
upload image in a form - by El Forum - 07-31-2012, 12:34 PM
upload image in a form - by El Forum - 07-31-2012, 03:26 PM



Theme © iAndrew 2016 - Forum software by © MyBB