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
https://forums.phpfreaks.com/topic/175954-click-field-to-enable/
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.

Archived

This topic is now archived and is closed to further replies.

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