From ba7627582928082681d1b88dacd057671bb427c4 Mon Sep 17 00:00:00 2001 From: Tayler Edelen Date: Mon, 27 Feb 2023 18:46:35 -0600 Subject: [PATCH 01/14] Added Form_HTML_Studio --- index.html | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index d78a52c..327c593 100644 --- a/index.html +++ b/index.html @@ -13,7 +13,16 @@
- + + + + + + + + +
\ No newline at end of file From 22175601770bd8e1cd9a0fe9bf47edfbc37e8875 Mon Sep 17 00:00:00 2001 From: Tayler Edelen Date: Mon, 27 Feb 2023 19:10:52 -0600 Subject: [PATCH 02/14] push --- index.html | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index 327c593..8ed7969 100644 --- a/index.html +++ b/index.html @@ -2,10 +2,28 @@ + + function setSearchEngine() {} + + let actions = { + "google": "https://www.google.com/search", + "duckDuckGo": "https://www.duckduckgo.com", + "bing": "https://www.bing.com/search", + "ask": "https://www.ask.com/web", + }; + + const form = document.querySelector('form'); + const searchEngineSelected = document.querySelector("input[name=engines]:checked"); + + let url = actions[searchEngineSelected.value]; + form.action = url; + } + @@ -15,10 +33,10 @@
- - - - + + + + From 412e894b7655ac0d4f69b5e8a5854601f845adfa Mon Sep 17 00:00:00 2001 From: Tayler Edelen Date: Mon, 27 Feb 2023 19:16:46 -0600 Subject: [PATCH 03/14] pushpush --- index.html | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/index.html b/index.html index 8ed7969..a349977 100644 --- a/index.html +++ b/index.html @@ -2,25 +2,27 @@ + + @@ -42,7 +44,7 @@ - + \ No newline at end of file From a3daaaf1441eca90fd6469986f8faa492e6c06cd Mon Sep 17 00:00:00 2001 From: Tayler Edelen Date: Mon, 27 Feb 2023 19:36:00 -0600 Subject: [PATCH 08/14] yasssss --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 00e8a3b..aa86723 100644 --- a/index.html +++ b/index.html @@ -18,7 +18,7 @@ // const form = document.querySelector('form'); //only form in page so it'll work const searchEngineSelected = document.querySelector("input[name=engine]:checked"); //example in book made plural to match forms, asking for checked selection - let url = actions.value; + let url = actions[searchEngineSelected.value]; form.action = url; //assigns url based on selection } From 7ec582c90fe78f1b220454988a890f098d5ce5d5 Mon Sep 17 00:00:00 2001 From: Tayler Edelen Date: Mon, 27 Feb 2023 19:37:46 -0600 Subject: [PATCH 09/14] changes --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index aa86723..2f40b2c 100644 --- a/index.html +++ b/index.html @@ -28,7 +28,7 @@ const button = document.querySelector('button'); button.addEventListener('submit', setSearchEngine); //not calling it, referencing it. submit events can be tied to form or button }); - }); + From 994efffdf7684d5736731c41403c1e40d23ced69 Mon Sep 17 00:00:00 2001 From: Tayler Edelen Date: Mon, 27 Feb 2023 19:59:28 -0600 Subject: [PATCH 10/14] yeppy --- index.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 2f40b2c..fd6d7ea 100644 --- a/index.html +++ b/index.html @@ -15,11 +15,12 @@ ask: "https://www.ask.com/web", }; - // const form = document.querySelector('form'); //only form in page so it'll work const searchEngineSelected = document.querySelector("input[name=engine]:checked"); //example in book made plural to match forms, asking for checked selection - + + let form = document.getElementById('searchForm'); let url = actions[searchEngineSelected.value]; form.action = url; //assigns url based on selection + form.setAttribute(actions, url); } From 4fa70586af11f47aac9fa740415e71712c1ba388 Mon Sep 17 00:00:00 2001 From: Tayler Edelen Date: Mon, 27 Feb 2023 20:11:03 -0600 Subject: [PATCH 11/14] yeppers --- index.html | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/index.html b/index.html index fd6d7ea..e8af850 100644 --- a/index.html +++ b/index.html @@ -15,19 +15,16 @@ ask: "https://www.ask.com/web", }; + let form = document.getElementById('searchForm'); //grab form element with getelementbyid const searchEngineSelected = document.querySelector("input[name=engine]:checked"); //example in book made plural to match forms, asking for checked selection - - let form = document.getElementById('searchForm'); - let url = actions[searchEngineSelected.value]; - form.action = url; //assigns url based on selection - form.setAttribute(actions, url); - } - + let url = actions[searchEngineSelected.value]; //look for input with radio button checked + form.setAttribute('action', action); + window.addEventListener("load", function(){ // TODO: register the handler - const button = document.querySelector('button'); - button.addEventListener('submit', setSearchEngine); //not calling it, referencing it. submit events can be tied to form or button + const form = document.getElementById('searchForm'); + form.addEventListener('submit', setSearchEngine); //not calling it, referencing it. submit events can be tied to form or button }); @@ -35,8 +32,8 @@ -
- + + From ef456eb975d0a195fc5e6cece458276b89b17e4c Mon Sep 17 00:00:00 2001 From: Tayler Edelen Date: Mon, 27 Feb 2023 20:15:35 -0600 Subject: [PATCH 12/14] hell --- index.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index e8af850..ba922e8 100644 --- a/index.html +++ b/index.html @@ -15,10 +15,10 @@ ask: "https://www.ask.com/web", }; - let form = document.getElementById('searchForm'); //grab form element with getelementbyid - const searchEngineSelected = document.querySelector("input[name=engine]:checked"); //example in book made plural to match forms, asking for checked selection - let url = actions[searchEngineSelected.value]; //look for input with radio button checked - form.setAttribute('action', action); + const form = document.getElementById('searchForm'); //grab form element with getelementbyid + const searchEngineSelected = document.querySelector('input[name=engine]:checked'); //example in book made plural to match forms, asking for checked selection + const url = actions[searchEngineSelected.value]; //look for input with radio button checked + form.setAttribute('action', url); //plaintext attribute we need to set, referring to if we had action in form id...if we replace action with id. other action is referncing url window.addEventListener("load", function(){ From 4b1f8543f00fcb903c6e9e03537afd08b224f8a0 Mon Sep 17 00:00:00 2001 From: Tayler Edelen Date: Mon, 27 Feb 2023 20:17:25 -0600 Subject: [PATCH 13/14] maybe --- index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index ba922e8..2809b10 100644 --- a/index.html +++ b/index.html @@ -17,7 +17,7 @@ const form = document.getElementById('searchForm'); //grab form element with getelementbyid const searchEngineSelected = document.querySelector('input[name=engine]:checked'); //example in book made plural to match forms, asking for checked selection - const url = actions[searchEngineSelected.value]; //look for input with radio button checked + const url = actions[searchEngineSelected?.value]; //look for input with radio button checked form.setAttribute('action', url); //plaintext attribute we need to set, referring to if we had action in form id...if we replace action with id. other action is referncing url @@ -32,7 +32,7 @@ - + From 170b684b93b5db86701fad47c023576ae7ff3eb4 Mon Sep 17 00:00:00 2001 From: Tayler Edelen Date: Mon, 27 Feb 2023 20:20:36 -0600 Subject: [PATCH 14/14] pleasework --- index.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index 2809b10..7b0d33d 100644 --- a/index.html +++ b/index.html @@ -16,13 +16,12 @@ }; const form = document.getElementById('searchForm'); //grab form element with getelementbyid - const searchEngineSelected = document.querySelector('input[name=engine]:checked'); //example in book made plural to match forms, asking for checked selection - const url = actions[searchEngineSelected?.value]; //look for input with radio button checked + const selectedEngine = document.querySelector('input[name=engine]:checked'); //example in book made plural to match forms, asking for checked selection + const url = actions[selectedEngine.value]; //look for input with radio button checked form.setAttribute('action', url); //plaintext attribute we need to set, referring to if we had action in form id...if we replace action with id. other action is referncing url - + } window.addEventListener("load", function(){ - // TODO: register the handler const form = document.getElementById('searchForm'); form.addEventListener('submit', setSearchEngine); //not calling it, referencing it. submit events can be tied to form or button }); @@ -39,6 +38,7 @@ +