Jump to content

execute write function


ninedoors

Recommended Posts

I am using the write function to put values into a textbox.  So the user clicks a form button, say button labelled '1' and then in the textbox they are focussed on 1 is written.  What I need to do now is have it auto focus when there is an input entered in the textbox to the next textbox.  I have a function that can do this but my problem is that when I write the value to the textbox the cursor isn't showing up after the entry.

 

So the auto focus function isn't working.  If I type in a value to the textbox it works fine.

 

Any ideas?  I am new to javascript and don't know any of the functions.  Is there a showCursor function?  Or something of that nature?

 

Nick

Link to comment
https://forums.phpfreaks.com/topic/106931-execute-write-function/
Share on other sites

Actually, now I think all I need to do is when the button is clicked and the text is wrtten to the textarea, I just need to move to the next tabindex.  I am having trouble retrieving the tabindex from the textbox where I am writing the text to.  Here is the function I am using:

 

function s (t){
if (window.last_element=='disable'){
	alert("Picker Ignore the selected input (NO_SUPPORT)\n");
	return false;
}

if (window.last_element==null){
	alert("Please select an input box before you use the picker");
	return false;
}
window.last_element.value += t.innerHTML;
window.last_element.tabindex = ti;

document.forms['statform'].elements[ti].focus();
}

function set_element(le){
window.last_element = le;
}

function put_picker(){
var vals = [1,2,3,4,5,6,7,8,9,10,11,12,];
				document.write('<div id="container" class="picker_container" style="width:90px">');
				for (ev in vals){
					document.write('<div class=box onclick="s(this)">'+vals[ev]+'</div>\r\n ');
				}
				document.write('</div>');
}

 

Thanks Nick

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.