I use javascript in my main.html (top template) to control the access
to several buttons. The buttons call a javascript function. This setup
works exactly as I wish except the buttons still don't really do
anything. I need to have each button load a different template. The
pertinent script is:
<script type="text/javascript">
"use strict"
var bn = ""
function buttoncontrol(bn){
var i = 0;
var bx = "";
var x = []; /*array*/
if (bn=="resetDone")
{
for (var i = 0; i < 4; i++)
{
bx= "b" + (i+1);
document.getElementById(bx)
.removeAttribute("disabled");
}
return
}
else {
for (var i = 0; i < 4; i++)
{
bx= "b" + (i+1);
document.getElementById(bx)
.setAttribute("disabled", "true");
}
switch(bn) {
case "b1":
document.write("<a href=
'welcome.html'>'Welcome.html'</a>");
break;
case "b2":
break;
case "b3":
break;
case "b4":
break;
default:
document.write("fell out the bottom");
}
return;
}
}
</script>
The code works till it hits the document.write statement and freezes.
This just plain doesn't work. What would. I want to keep this approach,
so I need an alternative to the document.write statement.
Both my main.html and my welcome.html are in the same template
directory. I bypassed the button during development and the two pages
worked well together.
Django 1.8
Python 3.4
Gary R.
--
You received this message because you are subscribed to the Google Groups "Django
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/566E0BC0.8020100%40verizon.net.
For more options, visit https://groups.google.com/d/optout.