Jump to content
php.lv forumi

if checked


anonīms

Recommended Posts

mysql_query("DELETE * FROM vestules WHERE id = '$vest_id'") or die(mysql_error());

echo "DELETE * FROM vestules WHERE id = '$vest_id'";

}

shadi ir gruti ,un brizjam pilnigi bezjedziigi debuugot..

jo tu 2 reizes Duble to Kveriju...

Ja 1 ielaidiisi Sintakses kljuudu , tad buus gruti to atrast....

---

$sql="SELECT * blaa...";

echo $sql;

mysql_query($sql);

---

Shadi buusi 100% parliecinats ka tas ir tas pats kas tiek padots DB ...

Link to comment
Share on other sites

Vēl saistīts ar šo skriptu, gribu izveidot check all f-ju, un mēģinu ar javascript, bet kaut kas nesanāk..

 

<script LANGUAGE="JavaScript">
function checkAll(field)
{
for (i = 0; i < field.length; i++)
field[i].checked = true;
}

function uncheckAll(field)
{
for (i = 0; i < field.length; i++)
field[i].checked = false;
}
</script>

 

<input type='checkbox' value='".$sanemtaas['0']."' name='id[]'/>

 

 

<input type=\"button\" name=\"Check All\" value=\"Ieķeksēt visu\" onClick=\"checkAll(document.vestules_visas.id[])\">
<input type=\"button\" name=\"UnCheckAll\" value=\"Atķeksēt visas\"
onClick=\"uncheckAll(document.myform.list)\">

 

Kas tur ir nepareizs?

Link to comment
Share on other sites

Caur validatoru saka, ka there is no attribute "LANGUAGE".

 

 

 

 

document.myform has no properties

onclick(click clientX=0, clientY=0)vestules (line 1)

[break on this error]

vestules (line 1)

syntax error

Edited by anonīms
Link to comment
Share on other sites

language="javascript" => type="text/javascript"

 

<script type="text/javascript">
function select(a) {
var theForm = document.myForm;
for (i=0; i<theForm.elements.length; i++) {
	if (theForm.elements[i].name=='mycheckbox[]')
		theForm.elements[i].checked = a;
}
}
</script>

<form name="myForm">
<input type="checkbox" name="mycheckbox[]" value="somevalue1" /><br/>
<input type="checkbox" name="mycheckbox[]" value="somevalue2" /><br/>
<input type="checkbox" name="mycheckbox[]" value="somevalue3" />
</form>

<a href="java script:select(1)">Check all</a> | <a href="java script:select(0)">Uncheck all</a>

Edited by Val
Link to comment
Share on other sites

<script type="text/javascript">
function select(a) {
var theForm = document.myForm;
for (i=0; i<theForm.elements.length; i++) {
	if (theForm.elements[i].name=='id[]')
		theForm.elements[i].checked = a;
}
}
</script>

 

<input type='checkbox' value='".$sanemtaas['0']."' name='id[]'/>

 

<form method=\"POST\" name=\"theForm\">
..............
<a href=\"java script:select(1)\">Ieķeksēt visas</a> | <a href=\"java script:select(0)\">Izķeksēt visas</a>
...................

Edited by anonīms
Link to comment
Share on other sites

Vēl nedaudz pie šī skripta

 

 

foreach($_POST["id"] as $vest_id) 
{
mysql_query("DELETE FROM vestules WHERE id = '$vest_id'");
}

 

<input type='submit' value='Dzēst atzīmētās vēstules' />

 

Kā input pogu varētu pārveidot par parastu linku?

Link to comment
Share on other sites

×
×
  • Create New...