Closed Thread Icon

Topic awaiting preservation: Defininig with the click on the row (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=12416" title="Pages that link to Topic awaiting preservation: Defininig with the click on the row (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: Defininig with the click on the row <span class="small">(Page 1 of 1)</span>\

 
retro_One
Nervous Wreck (II) Inmate

From: Zagreb, Croatia
Insane since: Sep 2002

posted posted 09-10-2002 11:20

i've been doing a news script for a client, and they wanted that they can select entry for update or erasing with the click on the news. So firstly my idea was to make the whole news a link that is sending variable (something like this: $news = "<a href=\"news.php?id=$news_id\">$news</a>", but that had limitations because you had to click the text to select it. But if I would make whole row a link it would solve the problem. And here is the part of the final script. And when you select the news the background automaticly changes.

print "<TR>";
if ($vijesti_num == '' and $brojac == 1) //this part automaticly selects first news on the list
{
$vijesti_num = $news_id;
}
if ($vijesti_num == $news_id)
{
$pozadina = "FFFFCC"; //this changes the background of the row
}
else
{
$pozadina ="FFFFFF";
}
print "<a href=$PHP_SELF?news_id=$news_id><TD bgcolor = \"$pozadina\"colspan=\"2\">";
print "<div align=\"left\"><font size=\"2\" face=\"Verdana, Arial, Helvetica, sans-serif\">";
echo ("<br>$news<br><br>");
print "</font></div>";
print "</TD></a>";
print "</TR>";

any comments??
----------------------------------------
You can't stop the prophet

----------------------------------------

[This message has been edited by retro_One (edited 09-10-2002).]

InI
Paranoid (IV) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 09-10-2002 11:33

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

retro_One
Nervous Wreck (II) Inmate

From: Zagreb, Croatia
Insane since: Sep 2002

posted posted 09-10-2002 11:45

I just want to improve it a little bit so if anyone has idea. The script is running on the client's server but i will try to put it on my server. The purpose is to select the news for editing by clickin' a row in the table

----------------------------------------
You can't stop the prophet

----------------------------------------

InI
Paranoid (IV) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 09-10-2002 11:53

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

stinx
Bipolar (III) Inmate

From: London, UK
Insane since: Apr 2002

posted posted 09-16-2002 12:06

Nah... I'd say put the <a> tag around the <tr> if anything

If found nothing in the xhtml standards that says you can't nest any tags inside an anchor (<a> ). It works, and like retro_One said, having to click on the actual text, not just the cell, or row seems to be a hassle for a lot of users. Cells are often highlighted with a background colour and look like big fat buttons. There's nothing more annoying that a support call where the user is trying to click on something they *think* should work, so you have to anticipate that, or make it much clearer.

Using the dhtml onClick event only serves to break the page for the paranoid people who run without scripting.

And as for the security hole... It's only an article ID. I'd worry if there was a username and password being sent, but there isn't. How else are you going to know which article needs to be edited? Or viewed?

Is $PHP_SELF a crucial value? Maybe we shouldn't send that through a simple href link....


InI
Paranoid (IV) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 09-16-2002 12:33

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

stinx
Bipolar (III) Inmate

From: London, UK
Insane since: Apr 2002

posted posted 09-16-2002 13:07

Bah, ok - I guess I should take more notice of that validator....

I don't see why it should't work - it's in the spirit of xml, and properly nested

Besides, I did a quick test and it only seems to work in IE anyway.

So what else? I also tried something along the lines of

code:
<td><a href=""><span style="width:150px;">link text</span></a></td>


which validates fine against the strict DTD, but again only seems to work in IE.

I seem to recall some report that XHTML 2 is going to allow the href attribute in just about any tag. But how long before that gets into a mainstream browser?

So for the moment, I guess it's going to have to be an onClick event in the <td>, but with an <a href> inside the td aswell, to support non-js?


InI
Paranoid (IV) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 09-16-2002 13:17

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

stinx
Bipolar (III) Inmate

From: London, UK
Insane since: Apr 2002

posted posted 09-16-2002 13:54

Hey, gimme a break - it's Monday morning (or it was)

As for the <span> tags, doh, I thought.. why not just set the display properties of the <a> tag? Still didn't seem to work right though... then I reread this post and decided I really should give up trying...

And Ini, I can't see how the target script is supposed to guess which news item you clicked on, but you're not going to tell us, so you should have kept your mouth shut on that point in the first place. This thing's far enough off topic as it is.


Emperor
Maniac (V) Mad Scientist with Finglongers

From: Cell 53, East Wing
Insane since: Jul 2001

posted posted 09-16-2002 15:05

retro_One: I think the simple answer is to not make your whole news article a link - it is unnecessary and could prove pretty confusing - just add a small edit post link. Its the conventional way to go about things and I see no reason to go changing it for this.

If you must set the styles on the A tag as display: block and then give it height and width - see another thread in the DHTML forum on making a cell a link or something.

[edit: and, of course stinx added the link in his post above:
http://www.ozoneasylum.com/Forum2/HTML/001764.html ]

___________________
Emps

FAQs: Emperor

« BackwardsOnwards »

Show Forum Drop Down Menu