Welcome Guest, Not a member yet? Register   Sign In
How to catch input type image?
#1

[eluser]aryan_[/eluser]
I'm using input type image in my form. It's name is submit, but using $this->input->post('submit') doesn't give me its value.

How should I catch image button?
#2

[eluser]siubie[/eluser]
you can use the php native function to get the image detail on upload form, and use

Code:
enctype="multipart/form-data"

to catch file type use :

Code:
$_FILES['userfile']['type']

if you using file uploading class, we can use $this->upload->data()

Code:
Array
(
    [file_name]    => mypic.jpg
    file_type]    => image/jpeg // -> file type
    [file_path]    => /path/to/your/upload/
    [full_path]    => /path/to/your/upload/jpg.jpg
    [raw_name]     => mypic
    [orig_name]    => mypic.jpg
    [file_ext]     => .jpg
    [file_size]    => 22.2
    [is_image]     => 1
    [image_width]  => 800
    [image_height] => 600
    [image_type]   => jpeg
    [image_size_str] => width="800" height="200"
)
#3

[eluser]Kenshiro[/eluser]
I think he is referring to the ability to use an image as a submit button, problem is that browser support is dodgy as best when using

Code:
<input type="image" src="...." name="submit" />

IEx will capture only the coordinates where the button was clicked and not submit the name "submit" firefox will do it though.

The best way is to use the

Code:
<button type="submit" class="anycsshere" name="submit">Submit</button>

And skin it accordingly ! Smile
#4

[eluser]siubie[/eluser]
ha ha my bad T_T dont read the questions correctly Smile




Theme © iAndrew 2016 - Forum software by © MyBB