I have an "input" page that allows someone to check a box which activates a datetime function, the page then returns to a display. My problem is that the input page can be relaoded and the box reticked, overwriting the displayed datetime.

As the page reloads with the box showing as ticked i thought i could detect its state and toggle a disabled attribute.
The java is not linked to a function "event" i just wanted it to fire on window load (there already another onload event)

function checksig(){
if (document.GetElementByName('SigExecLog').checked == "Checked")>
{document.GetElementByName('SigExecLog').disabled = "true"}
else
{document.GetElementByName('SigExecLog').disabled = "false"}


<input type="checkbox" name="SigExecLog" id="SigExecLog" value="Yes" disabled="disabled" onClick="checkSigExecLog();"></input>

Is this even possible?

After a few days im considering more radical solutions!.

Thanks.

Recommended Answers

All 3 Replies

<body onLoad=checkSig()>

Have you tried that?

No, i wanted to avoid assigning more functions to the onload , not to worry ill build a new secondary screen.

Many thanks

Have you thought about maybe checking the state of the datetime function instead of the box? Or an if statement for both? Maybe I don't understand what you mean, but if the datetime function is activated upon the checkbox, then if the value is changed, you may be able to detect that instead. Hopefully that made sense. :p

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.