Jump to content

Recommended Posts

hi,,,

 

I want on submit button all textbox values insert into Table1,

row wise. but I dont understand how i write code for this,can anyone help. please see the code.

 

 

 

 

 <?php ob_start();?>
<?php include("include/connection.php"); ?>  
  <?php include("include/header.php"); ?>


<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>                        
		</TR> 
                                
<tr>
<td width="16%"  ><input type="text" name="cid0" size="16" tabindex="1" onkeypress="handleKeyPress(event,this,id);" ></td>
</tr>

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

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

<tr>
<td width="16%"><input type="text" name="cid3" size="16" tabindex="4" onkeypress="handleKeyPress(event,this,id);" ></td>
</tr>

<tr>
<td width="16%"><input type="text" name="cid4" size="16" tabindex="5" onkeypress="handleKeyPress(event,this,id);" ></td>
</tr>

<tr>
<td width="16%"><input type="text" name="cid5" size="16" tabindex="6" onkeypress="handleKeyPress(event,this,id);" ></td>
</tr>

<tr>
<td width="16%"><input type="text" name="cid6" size="16" tabindex="7" onkeypress="handleKeyPress(event,this,id);" ></td>
</tr>


        </TABLE> 

<input type="submit" value="Submit"> 
            </form>
            </td>
            </tr>
            </table>

   <?php require_once("include/right.php"); ?>
<?php require_once("include/footer.php"); ?>

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/165451-inserting-values/
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.