Update locked till Rename field checked. - Locking Update or Checking the text Field
Hi,
I am trying to make the update (submit) button lock if there is an onChange in another field... At the same time I'd like to be able to give the user an alert message stating there has been a change in the field and the option to call the JS function for Rename then Submit... Any ideas?
elara posted this at 23:45 — 7th June 1999.
They have: 112 posts
Joined: Apr 1999
You can declare a boolean variable to determine whether the field has been modified or not.
The example is below, however you need to do some modifications yourself:
First write the script
var isModified = false; //global variable
function isFieldModified() {
if (isModified) {
if (confirm("Do you want to rename the field?")) {
rename(); //Call the rename function
}
}
return isModified;
}
and also add the onChange event handler to the input tag
<input type="text" name="fieldInput1" onChange="isModified=false;">
Then add the onsubmit event handler to the form tag
<form name="testForm" onSubmit="return isFieldModified()">
I don't know if this will work because I haven't tried it yet.
----------
Elara - Webmasters' Guide
http://elara.hypermart.net/
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.