Disable a button or make it readonly

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-11-2010 11:06 AM
Hi , I have added a new button on the form and its corresponding action. works good. I need to make it appear active conditionally on the form but not hide it. Just to make it disabled when the condition does not meet and not completely hide. Instead, show it but should not be active.
something like if(condition) (button.disabled=true) else (button.disabled=false)
I know this can be achieved through script, but how to grab the button id/name.
Thanks,
Shiva
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-12-2012 01:31 PM
One question, any idea how to remove the button using this script from both the header and the actual bottom part of the form?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-12-2012 01:43 PM
Can you just adjust the UI Action condition, so that the button does not get rendered?
This sounds like a different question, so if it is unrelated, please create a new topic, and post the link here.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-12-2012 02:09 PM
Hi Valor, thanks for the response... yes you can add it to the Condition field on the actual UI action. I forgot you could use 'current' on that condition. Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-12-2010 12:18 PM
Shiva,
Try this....
This disables the submit button onLoad
function onLoad() {
var refs = document.getElementsByTagName("BUTTON");
if (refs) {
for (var i=0; i < refs.length; i++) {
var ref = refs;
var inner = ref.innerHTML;
if (inner == 'Submit'){
ref.disabled = true;
}
}
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-12-2010 06:37 PM
Thanks, Jay!