Jump to content

Help, how to make dblclick text able?


samoi

Recommended Posts

Hello guys!

Subject is not clear, but I will have it as clear as I can!

First, I am totally new to the JS! I have some skills but not too much!

here is a code:

 

<?
include('func.php');
?>

<html>
<head>
<script language="JavaScript" type="text/javascript">

function editfield(u){
	var user = document.getElementById(user);
}

</script>
</head>
<body>
<table border="1">
	<tr>
		<td> username </td>
	</tr>
<?
while ($row = mysql_fetch_array($SQL)) {
    echo '<tr>';
    echo '<td name="user" onDblcilck="editfield()">' . $row['username'] . '</td>';
    echo '</tr>';
}

// HOWEVER! I need to edit $row['username']. So, on double click i need it to change to <input type="text" /> field!
// And then I need to get that variable of the edited username, and submitted it through a form to the db!

?>
</table>

</body>
</html>


 

I need when dblclick to convert the <td> to <input />! And I want to get the value of the edited user to submitted to the database!

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.