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
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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.