summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorParker Berberian <pberberian@iol.unh.edu>2018-12-03 19:22:36 +0000
committerGerrit Code Review <gerrit@opnfv.org>2018-12-03 19:22:36 +0000
commitc6f4fc073bd84b22864495959fad9a53b57e793c (patch)
treed289cf103ef99646587ca0605d5d6b320ee17f42
parente40592d14caf8b4c8d8e13b9623aeef7fee0eb4a (diff)
parent1bca75075deaa0922946194173def8e4cf6fb985 (diff)
Merge "Removed Vanilla Form Submission"
-rw-r--r--src/templates/dashboard/landing.html6
-rw-r--r--src/templates/resource/steps/meta_info.html8
-rw-r--r--src/templates/resource/steps/pod_definition.html1
-rw-r--r--src/templates/workflow/confirm.html33
4 files changed, 36 insertions, 12 deletions
diff --git a/src/templates/dashboard/landing.html b/src/templates/dashboard/landing.html
index 3e0aacd..b1eec86 100644
--- a/src/templates/dashboard/landing.html
+++ b/src/templates/dashboard/landing.html
@@ -28,12 +28,6 @@
grid-template-columns: 33% 34% 33%;
}
</style>
-<script type="text/javascript">
- function cwf(wf_type){
- document.getElementById('id_workflow').selectedIndex = wf_type;
- document.getElementById('wf_selection_form').submit();
- }
-</script>
<div class='wf_create_div'>
<button class="wf_create btn" onclick="cwf(0)">Create a Booking</button>
<button class="wf_create btn" onclick="cwf(1)">Create a Pod</button>
diff --git a/src/templates/resource/steps/meta_info.html b/src/templates/resource/steps/meta_info.html
index 389ff6d..b458842 100644
--- a/src/templates/resource/steps/meta_info.html
+++ b/src/templates/resource/steps/meta_info.html
@@ -14,5 +14,11 @@
{% endblock content %}
{% block onleave %}
-document.getElementById("resource_meta_form").submit();
+var ajaxForm = $("#resource_meta_form");
+var formData = ajaxForm.serialize();
+req = new XMLHttpRequest();
+req.open("POST", "/wf/workflow/", false);
+req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
+req.onerror = function() { alert("problem submitting form"); }
+req.send(formData);
{% endblock %}
diff --git a/src/templates/resource/steps/pod_definition.html b/src/templates/resource/steps/pod_definition.html
index ab9dfb3..b2b4998 100644
--- a/src/templates/resource/steps/pod_definition.html
+++ b/src/templates/resource/steps/pod_definition.html
@@ -596,7 +596,6 @@ function submitForm() {
var input_elem = document.getElementById("hidden_xml_input");
var s = encodeGraph(currentGraph);
input_elem.value = s;
- //form.submit();
req = new XMLHttpRequest();
req.open("POST", "/wf/workflow/", false);
req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
diff --git a/src/templates/workflow/confirm.html b/src/templates/workflow/confirm.html
index 555fa56..4f2616e 100644
--- a/src/templates/workflow/confirm.html
+++ b/src/templates/workflow/confirm.html
@@ -70,15 +70,28 @@
req.send(formData);
}
+ function submitForm()
+ {
+ var form = $("#confirmation_form");
+ var formData = form.serialize();
+ var req = new XMLHttpRequest();
+ req.open("POST", "/wf/workflow/", false);
+ req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
+ req.onerror = function() { alert("problem submitting confirmation"); }
+ req.onreadystatechange = function() { if(req.readyState === 4 ) { delete_manager(); } }
+ req.send(formData);
+ }
+
+
function formconfirm()
{
select.value = "True";
- document.getElementById("confirmation_form").submit();
+ submitForm();
}
function formcancel()
{
select.value = "False";
- document.getElementById("confirmation_form").submit();
+ submitForm();
}
var confirmed = {{bypassed|default:"false"}};
@@ -91,7 +104,20 @@
function fixVlans() {
document.getElementById("vlan_input").value = "True";
- document.getElementById("vlan_form").submit();
+ var form = $("#vlan_form");
+ var formData = form.serialize();
+ var req = new XMLHttpRequest();
+ req.open("POST", "/wf/workflow/", false);
+ req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
+ req.onerror = function() { alert("problem submitting form"); }
+ req.onreadystatechange = function() { //replaces current page with response
+ if(req.readyState === 4 ) {
+ document.open();
+ document.write(req.responseText);
+ document.close();
+ }
+ }
+ req.send(formData);
}
var problem = {{vlan_warning|default:'false'}};
if(problem){
@@ -121,5 +147,4 @@ if(problem){
{% endblock element_messages %}
{% endblock content %}
{% block onleave %}
-//document.getElementById("confirmation_form").submit();
{% endblock %}