Jump to content

problam,,help


popmotsy

Recommended Posts

hi guys,,

 

first see my code,,

 

I m takin input in textbox

 

("cid0,cid1,cid2...cid50..name of texbox")

 

using barcode scanner,,after scanning,cursor moves to next textbox

 

now if i change name of textbox mak them array,that means

 

cid[],cid[],cid[]....and so on,,then cursor doesnot move.

 

but here i hav to make them array,,and how can i mov cursor to next field...plz help...

 

 

 

 

<script type="text/javascript" >

function handleKeyPress(e,fldobj,nbox)
{
var key=e.keyCode || e.which;
if (key==13)
{
	event.cancelBubble = true; //Both lines stops auto submistion
	event.returnValue = false; //  by pressing ENTER (submit) button
	//alert (nbox);
	var next=fldobj.tabIndex; // this will grap the tabindex of the object passed to variable 'next'
	//alert (next);
	//alert (next);
	var nN='cid';		// 'nN' is a placeholder for storing the lable of first field 'cid'
	nN=nN+next;	// now both var concatinates for the creation of final text box name like 'cid0' 'cid1'
	//alert (nN);
	document.myform.elements[nN].focus(); // it will rotet the focus to the next element (textbox)
}

}
</SCRIPT> 


<?php require_once("include/top.php"); ?>
<?php require_once("include/left.php"); ?>   

<table align="center"><th align="center"> POD Entries</th></table>      





<table border="0" width="100%">
    <TR>
        <TD width="100%" align="center">
        <form name="myform" method="post" action="validpod.php" >
        <table align="center" border="1" style="font-size:12">
            
         <TR> 
                      <th align="center" >Barcode No</th> 

                      <th align="center" >POD No.</th> 

                      
	   </TR> 
            
<tr>
<td width="16%"  ><input type="text" name="cid0" size="16" tabindex="1" onkeypress="handleKeyPress(event,this,id);" ></td>
<td width="17%"><input type="text" name="podno[]"  tabindex="50" size="17"></td>
</tr>

<tr>
<td width="16%"><input type="text" name="cid1" size="16" tabindex="2" onkeypress="handleKeyPress(event,this,id);" ></td>
<td width="17%"><input type="text" name="podno[]"  tabindex="51" size="17"></td>

</tr>

<tr>
<td width="16%"><input type="text" name="cid2" size="16" tabindex="3" onkeypress="handleKeyPress(event,this,id);" ></td>
<td width="17%"><input type="text" name="podno[]"  tabindex="52" size="17"></td>

</tr>

 

 

Link to comment
Share on other sites

hi,,

 

i'll explain again.

 

I am taking input thru barcode scanner, after scanning curser automatically move to next textbox,,right.

 

Now , when i am takin array of textbox,

 

after takin input,, cursor doesn't move to next textbox,, thats my problam,,

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.