Alright, I'm at the end of my sanity and I'm trying to figure out where to begin. Basically what I need to do is be able to take inputs from a form and output them in a string.
However, I haven't really used JavaScript in almost a year and I've forgotten a lot of the commands and syntax.
In short, I'm not sure if I'm able to have a function where it basically says:
document.write("Title" + "Note" + "Priority") and then post it into todo_tasks or completed_tasks based on what radio input is selected when the user clicks the Save button.
I know how to do this with HTML5 localstorage, but I need to be able to do this on IE, and I'm not even sure where to begin with it.
As for JavaScript, what I have is just the functions I -think- I'll need, but I don't know where to begin with what I need to have in the brackets to make them work.
Code:
function newItem(){
}
function completeItem(){
document.getElementbyId("complete")
if (value=="completed") {
document.write("");
} else {
document.write("");
}
function onClick(){
}
function editItem(){
}
Any help, direction, advice, or links are greatly appreciated.
Ok, so a few more hours after working with it, I think I have enough of a JavaScript awareness again to at least ... kinda make the functions look like they're supposed to do what I want them to.
Basically what I'm trying to accomplish is a to-do list that posts the Title, Note, and Priority as a string like
"title" + "note" + "priority" so it might look like:
"Store | Get milk, eggs, bread | Low"
If I could get suggestions on how to figure a way to sort it so higher priority items are at the the top, that'd be great, but my focus right now is just getting the list to work.
In order to "check off" items, I'm trying to get it to apply a the "complete" class which turns the background color of the <li> that has that string black.
So, "Store | Get milk, eggs, bread | Low"
becomes equivalent to
"Store | Get milk, eggs, bread | Low"
so it's basically not seen.
function testMe() {
var title = document.getElementById("title").value;
alert(title);
}
function newNote() {
var title = document.getElementById('title').value;
var note = document.getElementById('note').value;
var priority = document.getElementById('priority').value;
var listItem = title+' | '+note+' | '+priority;
alert(listItem);
printList();
return newNote();
}
function printList() {
var list = document.getElementById('tasks');
var listNote = document.write(title+note+priority);
var li = document.createElement('li');
}
function completeItem() {
document.getElementById('li').className = "";
document.getElementById('li').onmousedown = toggleColor;
}
function toggleColor(evt) {
if (evt) {
var thisNote = evt.target;
} else {
var thisNote = window.event.srcElement;
}
if (thisNote == "") {
thisNote.className = "completed";
} else {
thisNote.className = "";
}
}
function resetField() {
}
Bookmarks