Quantcast
Channel: Symantec Connect - Endpoint Management - Discussions
Viewing all articles
Browse latest Browse all 6689

JavaScript Set Textbox to readonly/write

$
0
0
I need a solution

Hello,

I am trying to use a javascript to set a textbox to write if the  SQL query returns null data and does not fill out the textbox.  I am having trouble incorporating this into workflow.  I added the script to the form and create an onload event to call the function. 

I also tried adding the function to an event on the text box using onactivate, but it doesnt seem to work properly.  I set the text box to read only in workflow, then when the form loads and has no data in the field, i can write to it.  Once i click on the submit button all fields reset and error out saying field required.  Has anyone gotten this to work?

function ReadOnly()
 
{
 
var text = document.getElementById("textbox").value;
 
if (!text.match(/\S/))
 
{
 
document.getElementById("textbox").readOnly = false;
 
}else
 
{
 
return true;
 
}

Viewing all articles
Browse latest Browse all 6689

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>