Jump to content

Click field to enable


ejaboneta

Recommended Posts

I'm basically making a spreadsheet application that is one big form with multiple rows. I want the users to be able to update multiple rows at once. The problem is that I don't want rows that were not changed to be updated.

 

How can I have the field be enabled when the user clicks or changes it? I know I can do this with check boxes but I don't want the user to have to click the checkbox to do it. So perhaps a checkbox that is checked when the user changes a field? I don't know much javascript so any advice will help.

Link to comment
Share on other sites

You could always do something like this:

 

<html>
<head>
<SCRIPT type="text/javascript">
function makeChoice()
{
document.form1.otherChoice.disabled=false;
document.form1.otherChoice.focus();
}

function Edit(obj)
{
obj.disabled=false;
obj.style.display = '';
document.getElementById("noedit").style.display = 'none';

}
</script>
</head>
<body onload="document.form1.otherChoice.disabled=true"> <!-- This copies then shows the flash on body load -->
<form name="form1" action="#" method="post"><br>
<div ID="noedit" onClick="Edit(document.form1.otherChoice)"><b>ExampleUser</b></div><input type="text" id="otherChoice" value="ExampleUser" style="display: none;"><br>
</form>

</body>
</html>

 

let me know if this helps you.

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.