Tables HTML Toolkit [message #1060835] |
Tue, 28 May 2013 10:55  |
Eclipse User |
|
|
|
Hi all!
I'm trying to check the text in cell in HTML table. This is the HTML code of that displays the table:
<? include("langsettings.php"); ?>
<html>
<head>
<title>Phone Book HTML</title>
<link href="phonebook.css" rel="stylesheet" type="text/css">
</head>
<body>
<p>
<!-- Title displayed in the web page -->
<h1>PHONE BOOK</h1>
<?
// Create (connect to) SQLite database in file
$file_db = new PDO('sqlite:contacts.sqlite3');
// Set errormode to exceptions
$file_db->setAttribute(PDO::ATTR_ERRMODE,
PDO::ERRMODE_EXCEPTION);
?>
<!-- form section -->
<form action=phonebook.php?action=add& method=post>
<center>
<table border=0 cellpadding=0 cellspacing=3>
<!-- This is the first row of the form diplaying name and phone -->
<tr>
<td>Name</td><td><input type=text size=20 name=name></td>
<td>Phone</td><td><input testid="phone3" name="phone2" type=text size=20 name=phone></td>
</tr>
<!-- This is the second row of the form diplaying first name and photograph -->
<tr>
<td>First Name</td><td> <input type=text size=20 name=firstName></td>
<td>Photograph</td><td> <input type=text size=20 name=photo></td>
</tr>
<!-- Third row of the form displaying the button -->
<tr>
<td colspan=4> <input onclick="return error('KK')" class="tabbutton" type=submit border=0 value="SAVE NEW CONTACT" ></td>
</tr>
</table>
</center>
</form>
<center>
<table name="Contactos" testid="Contactos" border=0 cellpadding=0 cellspacing=0>
<?
$DO_YOU_WANT_TO_DELETE = "Do you want to delete ";
$FROM_YOUR_CONTACTS_LIST = " from your contacts list?";
$ERROR_MSG_NO_PHONE = "Please provide phone Number";
$ERROR_MSG_NO_NAME = "Please provide name";
$ERROR_MSG_NO_FIRST_NAME = "Please provide first name";
$action=@$_REQUEST['action'];
$firstname=@$_REQUEST['firstName'];
$name=@$_REQUEST['name'];
$phone=@$_REQUEST['phone'];
$photo=@$_REQUEST['photo'];
if($action=="add")
{
if ($photo=="") {
$photo="resources/no_image.png";
}
if ($firstname=="") {
echo "<script language='JavaScript'>
alert(\"$ERROR_MSG_NO_FIRST_NAME\");
</script>";
} else if ($name=="") {
echo "<script language='JavaScript'>
alert(\"$ERROR_MSG_NO_NAME\");
</script>";
} else if ($phone=="") {
echo "<script language='JavaScript'>
alert(\"$ERROR_MSG_NO_PHONE\");
</script>";
} else {
$file_db->query("INSERT INTO contacts (name, firstName, phone, photograph) VALUES('$name','$firstname','$phone','$photo')");
}
}
if(@$_REQUEST['action']=="del")
{
$file_db->query("DELETE FROM contacts WHERE contact=".round($_REQUEST['id']));
}
$result=$file_db->query("SELECT
contact,firstName, name, phone, photograph
FROM contacts ORDER BY name");
foreach($result as $row) {
echo "<tr>";
echo "<td class=tabphoto><img src=".$row['photograph']." width=100 height=100></td>";
echo "<td class=tabval>".$row['firstName']." ".$row['name']."</td>";
echo "<td class=tabval><img class='textmiddle' src='resources/telephone25.png' width='25' height='25'>".$row['phone']." </td>";
echo "<td class=tabval><a onclick=\"return confirm('".$DO_YOU_WANT_TO_DELETE.$row['firstName']." ".$name.$row['name'].$FROM_YOUR_CONTACTS_LIST."');\" href=phonebook.php?action=del&id=".$row['contact']."> <img class='textmiddle' src='resources/trash30.png' width='25' height='25'></a></td>";
echo "</tr>";
}
$file_db = null;
?>
</table>
</center>
</body>
</html>
I don't manage to check the contents of the cells. I use a Check Text(Specify Cell) and for the second column (displaying the full name) I enter 2 for the Column attribute. I think that I'm not specifying the row/column well because the test always fails independently if I set "equals" or "not equals" for the Text Operator. From the documentation I understand that you can enter the column/row indexes but the parameter is marked as String.
Any idea what I'm doing wrong? Thank you
Joaquin Morcate
|
|
|
|
|
Re: Tables HTML Toolkit [message #1061145 is a reply to message #1061124] |
Thu, 30 May 2013 04:30  |
Eclipse User |
|
|
|
Thank you very much for your answer Alex.
Yes, the table is properly mapped. Actually I have notice also some problems about that. In the OM Editor the technical name displayed is the "default name" build using the the contents of the table, although in the properties view the specified name "Contactos"(<table ... testid="Contactos" ...>) is displayed. But with the input for the phone number (<input ....testid="phone3" ... >) in both places the provided technical name (phone3) is displayed.
Nevertheless, I can run some tests that work fine using the table like checking that the table exists.
Thank you very much for your support offer, but I'm working with Jubula just for fun. On the other hand I want to find out how many people is actually interested in Jubula. If the community is not backing the project it won't last much longer. And honestly I can see you answering questions but very few people sharing their findings.
Well, I may be totally mistaken.
Thank you very much again
|
|
|
Powered by
FUDForum. Page generated in 0.03574 seconds