You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Thursday, June 14th 2018, 11:39pm

Focus on input type = "file"

hello allz, i have the same issue as the input text focus but this time it's with an input type ="file".
works well on computer but when i use my iphone or android i can't click on my button. I need to use landscape iphone display to work, and same issue with ipad..doesn't work..
i've try : to set it on autofocus by 3 way...

1:

Source code

1
inputelement.autofocus = "autofocus";

It's set well autofocus on computer (i see the button select when it's loaded, but don't work on my iphone)


2:

Source code

1
2
3
4
5
inputelement.addEventListener('touchstart',file_click, false);
function file_click()
{
inputelement.focus();
}


or these too :
3:

Source code

1
2
3
inputelement.addEventListener('touchstart',setfocus, false);

	function setfocus(){	 if(arguments.length<1)return;	 if(arguments[0]==='true')inputelement.focus();	 else inputelement.blur();	} 


and other things but nothing work :/ on landscape it's ok !


Another test with:

Source code

1
2
3
4
5
6
7
8
9
 inputelement = document.createElement("input");
 inputelement.type = "file";
 inputelement.id = "myID";

	function setfocus()
	{
 document.getElementById('myID').focus();

	}

This post has been edited 5 times, last edit by "ChukA" (Jun 15th 2018, 4:33pm)


2

Sunday, June 17th 2018, 7:05pm

it's ok then...
i've created a layer who call my Js fonction...

i don't know why the input "file" can't be clicked itself (but to be honest i don't care, 'cause i can put all style that i want to my layer :)), same issue with "checkbox" or "button".
regards
thread is close for me :)

Thxxx

3

Tuesday, July 3rd 2018, 10:59am

the response is: the input file don't need to be focused but clicked ;)