Sudoku checker by ayush [closed]jQuery plugin $(node).toJSON() - convert html form to JS ObjectInteractive...

In Japanese, what’s the difference between “Tonari ni” (となりに) and “Tsugi” (つぎ)? When would you use one over the other?

Collect Fourier series terms

Minkowski space

Why can't I see bouncing of a switch on an oscilloscope?

How can bays and straits be determined in a procedurally generated map?

Can I ask the recruiters in my resume to put the reason why I am rejected?

Did Shadowfax go to Valinor?

The use of multiple foreign keys on same column in SQL Server

Is it unprofessional to ask if a job posting on GlassDoor is real?

Have astronauts in space suits ever taken selfies? If so, how?

Why don't electron-positron collisions release infinite energy?

Can divisibility rules for digits be generalized to sum of digits

Languages that we cannot (dis)prove to be Context-Free

How is the claim "I am in New York only if I am in America" the same as "If I am in New York, then I am in America?

How to format long polynomial?

Replacing matching entries in one column of a file by another column from a different file

Email Account under attack (really) - anything I can do?

Why do I get two different answers for this counting problem?

Why "Having chlorophyll without photosynthesis is actually very dangerous" and "like living with a bomb"?

Why is Minecraft giving an OpenGL error?

How does one intimidate enemies without having the capacity for violence?

How to add double frame in tcolorbox?

Writing rule stating superpower from different root cause is bad writing

Modeling an IP Address



Sudoku checker by ayush [closed]


jQuery plugin $(node).toJSON() - convert html form to JS ObjectInteractive sliderSudoku Checker in JavaUsing/storing server-side data on the client sideFormmailer safetyOn hover, hide text and display optionsForms - Ordered fields vs. dynamic iterationsDecode HTML Entities in VBA using regex and dictionaryEnabling or disabling input fieldsSudoku puzzle solving algorithm that uses a rule-based approach to narrow the depth search






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







-2












$begingroup$


I have my general code but don't know how to add a function for my check answer button. Can somebody help me make a function for my check answer button?



<!DOCTYPE html>

<!-- Sudoku checking thing -->
<HTML>
<HEAD>
<TITLE>Ayush & Ranveer's sudoku checker</TITLE>
</HEAD>
<BODY>
<form method="post" name="Sudoku">
<input id="C1_1" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="1" type="TEXT">
<input id="C1_2" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C1_3" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="3" type="TEXT">
<input id="C1_4" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C1_5" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="5" type="TEXT">
<input id="C1_6" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C1_7" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="7" type="TEXT">
<input id="C1_8" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C1_9" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="9" type="TEXT">
<br>
<input id="C2_1" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C2_2" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="5" type="TEXT">
<input id="C2_3" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C2_4" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="7" type="TEXT">
<input id="C2_5" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C2_6" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="9" type="TEXT">
<input id="C2_7" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C2_8" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="2" type="TEXT">
<input id="C2_9" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<br>
<input id="C3_1" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="7" type="TEXT">
<input id="C3_2" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C3_3" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="9" type="TEXT">
<input id="C3_4" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C3_5" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="2" type="TEXT">
<input id="C3_6" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C3_7" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="4" type="TEXT">
<input id="C3_8" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C3_9" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="6" type="TEXT">
<br>
<input id="C4_1" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C4_2" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="3" type="TEXT">
<input id="C4_3" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C4_4" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="5" type="TEXT">
<input id="C4_5" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C4_6" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="7" type="TEXT">
<input id="C4_7" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C4_8" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="9" type="TEXT">
<input id="C4_9" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<br>
<input id="C5_1" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="5" type="TEXT">
<input id="C5_2" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C5_3" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="7" type="TEXT">
<input id="C5_4" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C5_5" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="9" type="TEXT">
<input id="C5_6" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C5_7" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="2" type="TEXT">
<input id="C5_8" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C5_9" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="4" type="TEXT">
<br>
<input id="C6_1" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C6_2" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="9" type="TEXT">
<input id="C6_3" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C6_4" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="2" type="TEXT">
<input id="C6_5" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C6_6" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="4" type="TEXT">
<input id="C6_7" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C6_8" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="6" type="TEXT">
<input id="C6_9" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<br>
<input id="C7_1" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="3" type="TEXT">
<input id="C7_2" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C7_3" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="5" type="TEXT">
<input id="C7_4" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C7_5" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="7" type="TEXT">
<input id="C7_6" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C7_7" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="9" type="TEXT">
<input id="C7_8" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C7_9" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="2" type="TEXT">
<br>
<input id="C8_1" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C8_2" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="7" type="TEXT">
<input id="C8_3" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C8_4" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="9" type="TEXT">
<input id="C8_5" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C8_6" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="2" type="TEXT">
<input id="C8_7" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C8_8" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="4" type="TEXT">
<input id="C8_9" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<br>
<input id="C9_1" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="9" type="TEXT">
<input id="C9_2" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C9_3" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="2" type="TEXT">
<input id="C9_4" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C9_5" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="4" type="TEXT">
<input id="C9_6" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C9_7" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="6" type="TEXT">
<input id="C9_8" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C9_9" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="8" type="TEXT">
<br>
<br>
<INPUT TYPE="button" VALUE="Read Cells" NAME="ReadCellsButton" onClick="ReadCells()">
<INPUT TYPE="button" VALUE="Restore Cells" NAME="RestoreCellsButton" onClick="RestoreCells()">
<INPUT TYPE="button" VALUE="Clear Puzzle" NAME="ClearPuzzleButton" onClick="ClearPuzzle()">
<INPUT TYPE="button" VALUE="Clear Text Area" NAME="ClearTextareaButton" onClick="ClearTextArea()">
<INPUT TYPE="button" VALUE="Check Answer" NAME="CheckAnswer" onClick="CheckAnswer()">
<textarea id="OutputText" rows="10" cols="80" readonly></textarea>
</form>
<SCRIPT LANGUAGE="JavaScript">
<!-- Beginning of JavaScript -

var puzzle = new Array(9);

for (i=0; i < 9; i++)
puzzle[i]=new Array(9);

// reads values from the Sudoku form, stores them in the puzzle[][] array,
// and writes them to the OutputText TEXTAREA

function ReadCells()
{
var cell;

document.getElementById('OutputText').value = "ReadCells():n";
for(i = 1; i <= 9; i++){
for(j = 1; j <= 9; j++){
cell = "C" + i + "_" + j;
puzzle[i-1][j-1] = document.getElementById(cell).value;
}
document.getElementById('OutputText').value += puzzle[i-1].join(" ");
document.getElementById('OutputText').value += "n";
}
}

// writes values from the puzzle[][] array to the Sudoku form
function RestoreCells()
{
var cell;

for(i = 1; i <= 9; i++){
for(j = 1; j <= 9; j++){
cell = "C" + i + "_" + j;
document.getElementById(cell).value = puzzle[i-1][j-1];
}
}
}

// clears the Sudoku form
function ClearPuzzle(form)
{
var cell;

for(i = 1; i <= 9; i++){
for(j = 1; j <= 9; j++){
cell = "C" + i + "_" + j;
document.getElementById(cell).value = "";
}
}

}

// clears the TEXTAREA below the Sudoku puzzle
function ClearTextArea(form){
document.getElementById('OutputText').value = "";
}

// - End of JavaScript - -->
</SCRIPT>
<BODY>
</HTML>









share|improve this question











$endgroup$



closed as off-topic by πάντα ῥεῖ, Sᴀᴍ Onᴇᴌᴀ, Simon Forsberg Mar 28 at 22:22


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review." – πάντα ῥεῖ, Sᴀᴍ Onᴇᴌᴀ, Simon Forsberg

If this question can be reworded to fit the rules in the help center, please edit the question.












  • 1




    $begingroup$
    Welcome to Code Review! Your question seems to be off-topic for Code Review, since you don't have working code to get feedback on. Questions on how to fix certain bugs or add a feature might be suitable for Stack Overflow instead.
    $endgroup$
    – Alex
    Mar 28 at 21:33










  • $begingroup$
    I would recommend to instead ask about how to cleanup your HTML to avoid the duplication. Assuming you want to do that that is...
    $endgroup$
    – Simon Forsberg
    Mar 28 at 22:22


















-2












$begingroup$


I have my general code but don't know how to add a function for my check answer button. Can somebody help me make a function for my check answer button?



<!DOCTYPE html>

<!-- Sudoku checking thing -->
<HTML>
<HEAD>
<TITLE>Ayush & Ranveer's sudoku checker</TITLE>
</HEAD>
<BODY>
<form method="post" name="Sudoku">
<input id="C1_1" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="1" type="TEXT">
<input id="C1_2" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C1_3" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="3" type="TEXT">
<input id="C1_4" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C1_5" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="5" type="TEXT">
<input id="C1_6" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C1_7" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="7" type="TEXT">
<input id="C1_8" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C1_9" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="9" type="TEXT">
<br>
<input id="C2_1" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C2_2" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="5" type="TEXT">
<input id="C2_3" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C2_4" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="7" type="TEXT">
<input id="C2_5" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C2_6" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="9" type="TEXT">
<input id="C2_7" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C2_8" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="2" type="TEXT">
<input id="C2_9" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<br>
<input id="C3_1" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="7" type="TEXT">
<input id="C3_2" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C3_3" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="9" type="TEXT">
<input id="C3_4" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C3_5" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="2" type="TEXT">
<input id="C3_6" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C3_7" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="4" type="TEXT">
<input id="C3_8" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C3_9" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="6" type="TEXT">
<br>
<input id="C4_1" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C4_2" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="3" type="TEXT">
<input id="C4_3" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C4_4" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="5" type="TEXT">
<input id="C4_5" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C4_6" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="7" type="TEXT">
<input id="C4_7" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C4_8" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="9" type="TEXT">
<input id="C4_9" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<br>
<input id="C5_1" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="5" type="TEXT">
<input id="C5_2" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C5_3" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="7" type="TEXT">
<input id="C5_4" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C5_5" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="9" type="TEXT">
<input id="C5_6" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C5_7" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="2" type="TEXT">
<input id="C5_8" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C5_9" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="4" type="TEXT">
<br>
<input id="C6_1" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C6_2" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="9" type="TEXT">
<input id="C6_3" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C6_4" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="2" type="TEXT">
<input id="C6_5" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C6_6" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="4" type="TEXT">
<input id="C6_7" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C6_8" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="6" type="TEXT">
<input id="C6_9" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<br>
<input id="C7_1" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="3" type="TEXT">
<input id="C7_2" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C7_3" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="5" type="TEXT">
<input id="C7_4" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C7_5" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="7" type="TEXT">
<input id="C7_6" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C7_7" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="9" type="TEXT">
<input id="C7_8" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C7_9" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="2" type="TEXT">
<br>
<input id="C8_1" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C8_2" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="7" type="TEXT">
<input id="C8_3" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C8_4" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="9" type="TEXT">
<input id="C8_5" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C8_6" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="2" type="TEXT">
<input id="C8_7" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C8_8" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="4" type="TEXT">
<input id="C8_9" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<br>
<input id="C9_1" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="9" type="TEXT">
<input id="C9_2" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C9_3" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="2" type="TEXT">
<input id="C9_4" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C9_5" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="4" type="TEXT">
<input id="C9_6" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C9_7" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="6" type="TEXT">
<input id="C9_8" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C9_9" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="8" type="TEXT">
<br>
<br>
<INPUT TYPE="button" VALUE="Read Cells" NAME="ReadCellsButton" onClick="ReadCells()">
<INPUT TYPE="button" VALUE="Restore Cells" NAME="RestoreCellsButton" onClick="RestoreCells()">
<INPUT TYPE="button" VALUE="Clear Puzzle" NAME="ClearPuzzleButton" onClick="ClearPuzzle()">
<INPUT TYPE="button" VALUE="Clear Text Area" NAME="ClearTextareaButton" onClick="ClearTextArea()">
<INPUT TYPE="button" VALUE="Check Answer" NAME="CheckAnswer" onClick="CheckAnswer()">
<textarea id="OutputText" rows="10" cols="80" readonly></textarea>
</form>
<SCRIPT LANGUAGE="JavaScript">
<!-- Beginning of JavaScript -

var puzzle = new Array(9);

for (i=0; i < 9; i++)
puzzle[i]=new Array(9);

// reads values from the Sudoku form, stores them in the puzzle[][] array,
// and writes them to the OutputText TEXTAREA

function ReadCells()
{
var cell;

document.getElementById('OutputText').value = "ReadCells():n";
for(i = 1; i <= 9; i++){
for(j = 1; j <= 9; j++){
cell = "C" + i + "_" + j;
puzzle[i-1][j-1] = document.getElementById(cell).value;
}
document.getElementById('OutputText').value += puzzle[i-1].join(" ");
document.getElementById('OutputText').value += "n";
}
}

// writes values from the puzzle[][] array to the Sudoku form
function RestoreCells()
{
var cell;

for(i = 1; i <= 9; i++){
for(j = 1; j <= 9; j++){
cell = "C" + i + "_" + j;
document.getElementById(cell).value = puzzle[i-1][j-1];
}
}
}

// clears the Sudoku form
function ClearPuzzle(form)
{
var cell;

for(i = 1; i <= 9; i++){
for(j = 1; j <= 9; j++){
cell = "C" + i + "_" + j;
document.getElementById(cell).value = "";
}
}

}

// clears the TEXTAREA below the Sudoku puzzle
function ClearTextArea(form){
document.getElementById('OutputText').value = "";
}

// - End of JavaScript - -->
</SCRIPT>
<BODY>
</HTML>









share|improve this question











$endgroup$



closed as off-topic by πάντα ῥεῖ, Sᴀᴍ Onᴇᴌᴀ, Simon Forsberg Mar 28 at 22:22


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review." – πάντα ῥεῖ, Sᴀᴍ Onᴇᴌᴀ, Simon Forsberg

If this question can be reworded to fit the rules in the help center, please edit the question.












  • 1




    $begingroup$
    Welcome to Code Review! Your question seems to be off-topic for Code Review, since you don't have working code to get feedback on. Questions on how to fix certain bugs or add a feature might be suitable for Stack Overflow instead.
    $endgroup$
    – Alex
    Mar 28 at 21:33










  • $begingroup$
    I would recommend to instead ask about how to cleanup your HTML to avoid the duplication. Assuming you want to do that that is...
    $endgroup$
    – Simon Forsberg
    Mar 28 at 22:22














-2












-2








-2





$begingroup$


I have my general code but don't know how to add a function for my check answer button. Can somebody help me make a function for my check answer button?



<!DOCTYPE html>

<!-- Sudoku checking thing -->
<HTML>
<HEAD>
<TITLE>Ayush & Ranveer's sudoku checker</TITLE>
</HEAD>
<BODY>
<form method="post" name="Sudoku">
<input id="C1_1" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="1" type="TEXT">
<input id="C1_2" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C1_3" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="3" type="TEXT">
<input id="C1_4" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C1_5" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="5" type="TEXT">
<input id="C1_6" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C1_7" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="7" type="TEXT">
<input id="C1_8" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C1_9" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="9" type="TEXT">
<br>
<input id="C2_1" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C2_2" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="5" type="TEXT">
<input id="C2_3" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C2_4" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="7" type="TEXT">
<input id="C2_5" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C2_6" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="9" type="TEXT">
<input id="C2_7" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C2_8" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="2" type="TEXT">
<input id="C2_9" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<br>
<input id="C3_1" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="7" type="TEXT">
<input id="C3_2" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C3_3" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="9" type="TEXT">
<input id="C3_4" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C3_5" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="2" type="TEXT">
<input id="C3_6" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C3_7" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="4" type="TEXT">
<input id="C3_8" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C3_9" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="6" type="TEXT">
<br>
<input id="C4_1" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C4_2" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="3" type="TEXT">
<input id="C4_3" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C4_4" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="5" type="TEXT">
<input id="C4_5" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C4_6" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="7" type="TEXT">
<input id="C4_7" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C4_8" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="9" type="TEXT">
<input id="C4_9" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<br>
<input id="C5_1" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="5" type="TEXT">
<input id="C5_2" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C5_3" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="7" type="TEXT">
<input id="C5_4" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C5_5" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="9" type="TEXT">
<input id="C5_6" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C5_7" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="2" type="TEXT">
<input id="C5_8" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C5_9" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="4" type="TEXT">
<br>
<input id="C6_1" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C6_2" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="9" type="TEXT">
<input id="C6_3" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C6_4" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="2" type="TEXT">
<input id="C6_5" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C6_6" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="4" type="TEXT">
<input id="C6_7" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C6_8" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="6" type="TEXT">
<input id="C6_9" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<br>
<input id="C7_1" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="3" type="TEXT">
<input id="C7_2" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C7_3" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="5" type="TEXT">
<input id="C7_4" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C7_5" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="7" type="TEXT">
<input id="C7_6" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C7_7" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="9" type="TEXT">
<input id="C7_8" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C7_9" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="2" type="TEXT">
<br>
<input id="C8_1" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C8_2" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="7" type="TEXT">
<input id="C8_3" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C8_4" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="9" type="TEXT">
<input id="C8_5" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C8_6" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="2" type="TEXT">
<input id="C8_7" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C8_8" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="4" type="TEXT">
<input id="C8_9" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<br>
<input id="C9_1" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="9" type="TEXT">
<input id="C9_2" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C9_3" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="2" type="TEXT">
<input id="C9_4" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C9_5" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="4" type="TEXT">
<input id="C9_6" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C9_7" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="6" type="TEXT">
<input id="C9_8" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C9_9" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="8" type="TEXT">
<br>
<br>
<INPUT TYPE="button" VALUE="Read Cells" NAME="ReadCellsButton" onClick="ReadCells()">
<INPUT TYPE="button" VALUE="Restore Cells" NAME="RestoreCellsButton" onClick="RestoreCells()">
<INPUT TYPE="button" VALUE="Clear Puzzle" NAME="ClearPuzzleButton" onClick="ClearPuzzle()">
<INPUT TYPE="button" VALUE="Clear Text Area" NAME="ClearTextareaButton" onClick="ClearTextArea()">
<INPUT TYPE="button" VALUE="Check Answer" NAME="CheckAnswer" onClick="CheckAnswer()">
<textarea id="OutputText" rows="10" cols="80" readonly></textarea>
</form>
<SCRIPT LANGUAGE="JavaScript">
<!-- Beginning of JavaScript -

var puzzle = new Array(9);

for (i=0; i < 9; i++)
puzzle[i]=new Array(9);

// reads values from the Sudoku form, stores them in the puzzle[][] array,
// and writes them to the OutputText TEXTAREA

function ReadCells()
{
var cell;

document.getElementById('OutputText').value = "ReadCells():n";
for(i = 1; i <= 9; i++){
for(j = 1; j <= 9; j++){
cell = "C" + i + "_" + j;
puzzle[i-1][j-1] = document.getElementById(cell).value;
}
document.getElementById('OutputText').value += puzzle[i-1].join(" ");
document.getElementById('OutputText').value += "n";
}
}

// writes values from the puzzle[][] array to the Sudoku form
function RestoreCells()
{
var cell;

for(i = 1; i <= 9; i++){
for(j = 1; j <= 9; j++){
cell = "C" + i + "_" + j;
document.getElementById(cell).value = puzzle[i-1][j-1];
}
}
}

// clears the Sudoku form
function ClearPuzzle(form)
{
var cell;

for(i = 1; i <= 9; i++){
for(j = 1; j <= 9; j++){
cell = "C" + i + "_" + j;
document.getElementById(cell).value = "";
}
}

}

// clears the TEXTAREA below the Sudoku puzzle
function ClearTextArea(form){
document.getElementById('OutputText').value = "";
}

// - End of JavaScript - -->
</SCRIPT>
<BODY>
</HTML>









share|improve this question











$endgroup$




I have my general code but don't know how to add a function for my check answer button. Can somebody help me make a function for my check answer button?



<!DOCTYPE html>

<!-- Sudoku checking thing -->
<HTML>
<HEAD>
<TITLE>Ayush & Ranveer's sudoku checker</TITLE>
</HEAD>
<BODY>
<form method="post" name="Sudoku">
<input id="C1_1" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="1" type="TEXT">
<input id="C1_2" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C1_3" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="3" type="TEXT">
<input id="C1_4" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C1_5" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="5" type="TEXT">
<input id="C1_6" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C1_7" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="7" type="TEXT">
<input id="C1_8" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C1_9" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="9" type="TEXT">
<br>
<input id="C2_1" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C2_2" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="5" type="TEXT">
<input id="C2_3" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C2_4" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="7" type="TEXT">
<input id="C2_5" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C2_6" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="9" type="TEXT">
<input id="C2_7" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C2_8" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="2" type="TEXT">
<input id="C2_9" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<br>
<input id="C3_1" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="7" type="TEXT">
<input id="C3_2" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C3_3" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="9" type="TEXT">
<input id="C3_4" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C3_5" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="2" type="TEXT">
<input id="C3_6" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C3_7" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="4" type="TEXT">
<input id="C3_8" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C3_9" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="6" type="TEXT">
<br>
<input id="C4_1" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C4_2" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="3" type="TEXT">
<input id="C4_3" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C4_4" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="5" type="TEXT">
<input id="C4_5" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C4_6" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="7" type="TEXT">
<input id="C4_7" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C4_8" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="9" type="TEXT">
<input id="C4_9" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<br>
<input id="C5_1" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="5" type="TEXT">
<input id="C5_2" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C5_3" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="7" type="TEXT">
<input id="C5_4" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C5_5" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="9" type="TEXT">
<input id="C5_6" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C5_7" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="2" type="TEXT">
<input id="C5_8" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C5_9" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="4" type="TEXT">
<br>
<input id="C6_1" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C6_2" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="9" type="TEXT">
<input id="C6_3" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C6_4" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="2" type="TEXT">
<input id="C6_5" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C6_6" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="4" type="TEXT">
<input id="C6_7" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C6_8" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="6" type="TEXT">
<input id="C6_9" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<br>
<input id="C7_1" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="3" type="TEXT">
<input id="C7_2" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C7_3" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="5" type="TEXT">
<input id="C7_4" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C7_5" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="7" type="TEXT">
<input id="C7_6" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C7_7" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="9" type="TEXT">
<input id="C7_8" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C7_9" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="2" type="TEXT">
<br>
<input id="C8_1" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C8_2" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="7" type="TEXT">
<input id="C8_3" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C8_4" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="9" type="TEXT">
<input id="C8_5" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C8_6" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="2" type="TEXT">
<input id="C8_7" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C8_8" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="4" type="TEXT">
<input id="C8_9" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<br>
<input id="C9_1" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="9" type="TEXT">
<input id="C9_2" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C9_3" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="2" type="TEXT">
<input id="C9_4" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C9_5" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="4" type="TEXT">
<input id="C9_6" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C9_7" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="6" type="TEXT">
<input id="C9_8" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C9_9" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="8" type="TEXT">
<br>
<br>
<INPUT TYPE="button" VALUE="Read Cells" NAME="ReadCellsButton" onClick="ReadCells()">
<INPUT TYPE="button" VALUE="Restore Cells" NAME="RestoreCellsButton" onClick="RestoreCells()">
<INPUT TYPE="button" VALUE="Clear Puzzle" NAME="ClearPuzzleButton" onClick="ClearPuzzle()">
<INPUT TYPE="button" VALUE="Clear Text Area" NAME="ClearTextareaButton" onClick="ClearTextArea()">
<INPUT TYPE="button" VALUE="Check Answer" NAME="CheckAnswer" onClick="CheckAnswer()">
<textarea id="OutputText" rows="10" cols="80" readonly></textarea>
</form>
<SCRIPT LANGUAGE="JavaScript">
<!-- Beginning of JavaScript -

var puzzle = new Array(9);

for (i=0; i < 9; i++)
puzzle[i]=new Array(9);

// reads values from the Sudoku form, stores them in the puzzle[][] array,
// and writes them to the OutputText TEXTAREA

function ReadCells()
{
var cell;

document.getElementById('OutputText').value = "ReadCells():n";
for(i = 1; i <= 9; i++){
for(j = 1; j <= 9; j++){
cell = "C" + i + "_" + j;
puzzle[i-1][j-1] = document.getElementById(cell).value;
}
document.getElementById('OutputText').value += puzzle[i-1].join(" ");
document.getElementById('OutputText').value += "n";
}
}

// writes values from the puzzle[][] array to the Sudoku form
function RestoreCells()
{
var cell;

for(i = 1; i <= 9; i++){
for(j = 1; j <= 9; j++){
cell = "C" + i + "_" + j;
document.getElementById(cell).value = puzzle[i-1][j-1];
}
}
}

// clears the Sudoku form
function ClearPuzzle(form)
{
var cell;

for(i = 1; i <= 9; i++){
for(j = 1; j <= 9; j++){
cell = "C" + i + "_" + j;
document.getElementById(cell).value = "";
}
}

}

// clears the TEXTAREA below the Sudoku puzzle
function ClearTextArea(form){
document.getElementById('OutputText').value = "";
}

// - End of JavaScript - -->
</SCRIPT>
<BODY>
</HTML>






html sudoku






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 28 at 21:40







Ayush

















asked Mar 28 at 21:27









AyushAyush

11




11




closed as off-topic by πάντα ῥεῖ, Sᴀᴍ Onᴇᴌᴀ, Simon Forsberg Mar 28 at 22:22


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review." – πάντα ῥεῖ, Sᴀᴍ Onᴇᴌᴀ, Simon Forsberg

If this question can be reworded to fit the rules in the help center, please edit the question.







closed as off-topic by πάντα ῥεῖ, Sᴀᴍ Onᴇᴌᴀ, Simon Forsberg Mar 28 at 22:22


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review." – πάντα ῥεῖ, Sᴀᴍ Onᴇᴌᴀ, Simon Forsberg

If this question can be reworded to fit the rules in the help center, please edit the question.








  • 1




    $begingroup$
    Welcome to Code Review! Your question seems to be off-topic for Code Review, since you don't have working code to get feedback on. Questions on how to fix certain bugs or add a feature might be suitable for Stack Overflow instead.
    $endgroup$
    – Alex
    Mar 28 at 21:33










  • $begingroup$
    I would recommend to instead ask about how to cleanup your HTML to avoid the duplication. Assuming you want to do that that is...
    $endgroup$
    – Simon Forsberg
    Mar 28 at 22:22














  • 1




    $begingroup$
    Welcome to Code Review! Your question seems to be off-topic for Code Review, since you don't have working code to get feedback on. Questions on how to fix certain bugs or add a feature might be suitable for Stack Overflow instead.
    $endgroup$
    – Alex
    Mar 28 at 21:33










  • $begingroup$
    I would recommend to instead ask about how to cleanup your HTML to avoid the duplication. Assuming you want to do that that is...
    $endgroup$
    – Simon Forsberg
    Mar 28 at 22:22








1




1




$begingroup$
Welcome to Code Review! Your question seems to be off-topic for Code Review, since you don't have working code to get feedback on. Questions on how to fix certain bugs or add a feature might be suitable for Stack Overflow instead.
$endgroup$
– Alex
Mar 28 at 21:33




$begingroup$
Welcome to Code Review! Your question seems to be off-topic for Code Review, since you don't have working code to get feedback on. Questions on how to fix certain bugs or add a feature might be suitable for Stack Overflow instead.
$endgroup$
– Alex
Mar 28 at 21:33












$begingroup$
I would recommend to instead ask about how to cleanup your HTML to avoid the duplication. Assuming you want to do that that is...
$endgroup$
– Simon Forsberg
Mar 28 at 22:22




$begingroup$
I would recommend to instead ask about how to cleanup your HTML to avoid the duplication. Assuming you want to do that that is...
$endgroup$
– Simon Forsberg
Mar 28 at 22:22










0






active

oldest

votes

















0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes

Popular posts from this blog

Fairchild Swearingen Metro Inhaltsverzeichnis Geschichte | Innenausstattung | Nutzung | Zwischenfälle...

Pilgersdorf Inhaltsverzeichnis Geografie | Geschichte | Bevölkerungsentwicklung | Politik | Kultur...

Marineschifffahrtleitung Inhaltsverzeichnis Geschichte | Heutige Organisation der NATO | Nationale und...