aryan/formfunction Function Calls #7
17
src/main.js
17
src/main.js
|
@ -35,3 +35,20 @@ const ollama_chat_complete = async (model, messages) => {
|
|||
const js = await res.json()
|
||||
return js
|
||||
}
|
||||
|
||||
const form = document.getElementById('chat-form')
|
||||
|
||||
|
||||
form.addEventListener('submit', FormSubmit);
|
||||
akemi
commented
Probably put the handle after the function definition. Probably put the handle after the function definition.
|
||||
|
||||
function FormSubmit(event) {
|
||||
// do we have to prevent default form submission behaviour? im not sure
|
||||
const query = document.getElementById('username').value;
|
||||
|
||||
FutureFunction(query);
|
||||
}
|
||||
|
||||
function FutureFunction(query) {
|
||||
// we put everything that happens with the query here
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue
Does this need to be a global variable?