vali php options with javascript
Posted: Sat Oct 24, 2009 5:54 pm
is there anyway to let a message popup if its empty selected option using javascript?
any help?
if(isset($add)) {
echo "<form name='form1' action='edit.php?&now=$now&nid=$nid' method='post'>\n";
echo "<div id='divEdit'>\n"
."<table width='100%'>\n"
."<tr>\n"
."<td width='10%'></td>\n"
."<td width='70%'>"._INPUT."</td>\n"
."<td width='10%'></td>\n"
."</tr>\n";
$query = "SELECT * FROM templates WHERE type != 'campaign' ORDER BY tid ASC";
$result5 = my_sql_query($query, "tid") or die ("Couldn't execute query because: ".mysql_error());
//echo $result5[0].'<br>';
//echo $result5[2]['num_rows'].'<br>';
echo "<tr>\n"
."<td width='0%'></td>\n"
."<td width='70%'><input name='contenttext' type='text' size='30' maxlength='50'> ";
echo " <em>select</em> <select>";
echo "<option value=''></option";
foreach($result5[1] as $key => $value )
{
echo "<option value='1'>";
echo $value['description']."<br />";
echo "</option>";
}
echo "</select></td>";
echo "</tr>\n";
echo "<tr>\n"
."<td width='100%' colspan='3'></td>\n"
."</tr>\n"
."<tr>\n"
."<td width='10%'></td>\n"
."<td width='70%'><input type='submit' name='newCampaign' value='"._ADD."' id='button'> <input type='submit' name='reset' value='"._RESET."' id='button'></td>\n"
."<td width='10%'></td>\n"
."</tr>\n";
echo "</table>\n"
."</div>\n"
."</form>\n";
any help?
if(isset($add)) {
echo "<form name='form1' action='edit.php?&now=$now&nid=$nid' method='post'>\n";
echo "<div id='divEdit'>\n"
."<table width='100%'>\n"
."<tr>\n"
."<td width='10%'></td>\n"
."<td width='70%'>"._INPUT."</td>\n"
."<td width='10%'></td>\n"
."</tr>\n";
$query = "SELECT * FROM templates WHERE type != 'campaign' ORDER BY tid ASC";
$result5 = my_sql_query($query, "tid") or die ("Couldn't execute query because: ".mysql_error());
//echo $result5[0].'<br>';
//echo $result5[2]['num_rows'].'<br>';
echo "<tr>\n"
."<td width='0%'></td>\n"
."<td width='70%'><input name='contenttext' type='text' size='30' maxlength='50'> ";
echo " <em>select</em> <select>";
echo "<option value=''></option";
foreach($result5[1] as $key => $value )
{
echo "<option value='1'>";
echo $value['description']."<br />";
echo "</option>";
}
echo "</select></td>";
echo "</tr>\n";
echo "<tr>\n"
."<td width='100%' colspan='3'></td>\n"
."</tr>\n"
."<tr>\n"
."<td width='10%'></td>\n"
."<td width='70%'><input type='submit' name='newCampaign' value='"._ADD."' id='button'> <input type='submit' name='reset' value='"._RESET."' id='button'></td>\n"
."<td width='10%'></td>\n"
."</tr>\n";
echo "</table>\n"
."</div>\n"
."</form>\n";