473,581 Members | 2,304 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

adding line-through style to a table row

I want that if user clicks in a checkbox, the strike-through effect applices
to current table row. I tried the following code in IE, but nothing happens.

Any idea ?

<table>
<tr><td><inpu t type=checkbox onclick="cboncl ick(this)"></td>
<td><input type=text value="Row 1" ></td>
<td><select><op tion>pine</option><option> orange</option></select></td></tr>

<tr><td><inpu t type=checkbox onclick="cboncl ick(this)"></td>
<td><input type=text value="Row 2"></td>
<td><select><op tion>apple</option><option> kiwi</option></select></td></tr>
</table>

<script>
function cbonclick(othis ) {
othis.parentNod e.parentNode.st yle.textDecorat ion=
othis.checked? 'line-through':'';
}
</script>

Jul 20 '05 #1
6 15007
"Andrus" <no************ ****@online.ee> writes:
I want that if user clicks in a checkbox, the strike-through effect applices
to current table row. I tried the following code in IE, but nothing happens.


You can't make strike-through (or any other text decoration) affect
input or select elements.

<input type="text" value="test" style="text-decoration:stri ke-through">
gives normal text in the textbox.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit. html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #2
DU
Lasse Reichstein Nielsen wrote:
"Andrus" <no************ ****@online.ee> writes:

I want that if user clicks in a checkbox, the strike-through effect applices
to current table row. I tried the following code in IE, but nothing happens.

You can't make strike-through (or any other text decoration) affect
input or select elements.


line-through works in select (at least options in select) in NS 7.x,
Mozilla-based browsers. One could also simply change the color from
black to silver for input type="text" and options and then make the
input and select disabled=true.

<input type="text" value="test" style="text-decoration:stri ke-through">
gives normal text in the textbox.

/L


CSS2 is line-through, not strike-through.

DU
--
Javascript and Browser bugs:
http://www10.brinkster.com/doctorunclear/

Jul 20 '05 #3
DU <dr*******@hotR EMOVEmail.com> writes:
line-through works in select (at least options in select) in NS 7.x,
Mozilla-based browsers.
It appears it works in IE6 too. I was checking in Opera 7, where it
doesn't.
Ofcourse, saying anything about input elements in general is dangerous,
since there is no standard that defines how they look.
CSS2 is line-through, not strike-through.


Doh. That's what I meant, ofcourse.
/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit. html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #4

"Lasse Reichstein Nielsen" <lr*@hotpop.com > wrote in message
news:7k******** **@hotpop.com.. .
DU <dr*******@hotR EMOVEmail.com> writes:
line-through works in select (at least options in select) in NS 7.x,
Mozilla-based browsers.
It appears it works in IE6 too. I was checking in Opera 7, where it
doesn't.
Ofcourse, saying anything about input elements in general is dangerous,
since there is no standard that defines how they look.
CSS2 is line-through, not strike-through.


The code below following code shows line-through effect in IE 6

I have a table whose rows contain

<input type=text>, <input type=checkbox>, <span> <select> and <textarea>
elements cells.

Which is the best way to change cbonclick() so that it applies this effect
to all elements in table row ?

<table>
<tr><td><inpu t type=checkbox onclick="cboncl ick(this)"></td>
<td><input type=text value="Row 1" ></td>
<td><select><op tion>pine</option><option> orange</option></select></td></tr>

<tr><td><inpu t type=checkbox onclick="cboncl ick(this)"></td>
<td><input type=text value="Row 2" style="text-decoration:line-through"</td>

<td><select style="text-decoration:line-through"><optio n>apple</option>
<option>kiwi</option></select></td></tr>
</table>

<script>
function cbonclick(othis ) {
othis.parentNod e.parentNode.st yle.textDecorat ion=
'line-through';
}
</script>
Jul 20 '05 #5
y-*******@em-lyon.com (Yep) writes:
Well it seems to work as of my Opera7b version, or are my glasses
striken-through ;-) See code below (a bit strange I'll admit, but IMHO
quite adapted to the problematic, especially in regards of the CSS
complex issues involved).
When I test it in O7.20b1, only the text Hello is line-through'ed, not
the input or select elements.
/*@cc_on
What does this fancy comment do? It is something in JScript.NET, right?
Shouldn't it be /*@cc_on */ ?
Uncommenting the next line made no difference in Opera 7.20b1.
elems={td:true, input:true, select:true};


/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit. html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #6
Yep
Lasse Reichstein Nielsen <lr*@hotpop.com > wrote in message news:<7k******* ***@hotpop.com> ...
y-*******@em-lyon.com (Yep) writes:
When I test it in O7.20b1, only the text Hello is line-through'ed, not
the input or select elements.


Interesting. The version I've been testing on is
Version 7.0
Build 2349
Platform Win32
System Windows 98
and it strikes the INPUT and SELECT elements correctly. If you add
inline style to the form controls, it even strikes twice :-)
/*@cc_on

What does this fancy comment do? It is something in JScript.NET, right?


Well I don't know for JScript.Net; in (good old) JScript that's
conditional compilation; the point actually is that browser detection
was
(IMHO) required here, given the CSS complex rules and UAs different
behaviors I'd come across (your findings with latest O7 may change the
approach, though).
Regards,
Yep.
Jul 20 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
19288
by: Garry | last post by:
Hi, I am new to python, hope someone can help me here: I have a MS Access exported .txt file which is tab delimited in total 20 columns, now I need to add another column of zero at the 4th column position and a column of zero at the 9th column position. What is the best way to do this? Can I write a while loop to count the number of tab I hit...
1
2244
by: Geoff Biggs | last post by:
Evening all, I'm trying to add a new built-in number data type to Python with its own syntax, so I'm working directly with the interpreter rather than creating my own extension module (side note: I've appended something extra to the version thing in the Makefile - I doubt this is relevant to the problem but it's probably best you have all...
10
4860
by: David | last post by:
Can anyone give me a quick code snippet (that is standards-based) for adding OPTION tags to a SELECT dynamically. I have no problem doing it in IE but I am kind of new to the whole standards world and can't figure out how to make it work in, for instance, Firefox. Right now the code I am using is as follows: ...
11
2281
by: Steven D'Aprano | last post by:
Suppose I create a class with some methods: py> class C: .... def spam(self, x): .... print "spam " * x .... def ham(self, x): .... print "ham * %s" % x .... py> C().spam(3) spam spam spam
3
1564
by: AMD Desktop | last post by:
Hi, I need to add a header to a datagrid. This is the code I am trying to use: Dim dgStaffingReport As New DataGrid Dim dgitem As New DataGridItem(0, 0, ListItemType.Header) Dim mycell As New TableCell()
2
2644
by: Anna | last post by:
I added a small Web.Config file to the root of my website so that I could view errors on a machine other than the server: <configuration> <system.web> <customErrors mode="Off" /> </system.web> </configuration> However, this immediately threw a different error when I tried to view
1
15866
by: Brian Conklin | last post by:
Hello Eneryone, I am having a problem. I have written a little app that will take a text "pipe" delimited file and place all of the values in to an Excel spreadsheet. It works great on any of my XP Pro machines. When I install the app on a Win2K Pro machine, I get the following error message: ************** Exception Text **************...
6
1405
by: John Salerno | last post by:
Ok, this might look familiar. I'd like to use regular expressions to change this line: self.source += '<p>' + paragraph + '</p>\n\n' to read: self.source += '<p>%s</p>\n\n' % paragraph Now, matching the middle part and replacing it with '%s' is easy, but
8
19924
by: Jason | last post by:
Hello, I am trying to utilitze the AJAX Control toolkit in my asp.net project. I have added a reference to AjaxControlToolkit.dll, and in my page, added these lines of code: <ajaxToolkit:ToolkitScriptManager runat="Server" EnableScriptGlobalization="true" EnableScriptLocalization="true" ID="ScriptManager1" />
5
2421
by: yuleball | last post by:
I am designing an editor program using rich text box in vb 6.0. I want to add a special box for entering verse or poems so that when I click a button, this box is placed at current position of cursor e-g if cursor is at line#3, the box is placed at line#3 and focus is changed from rtb to box. And after entering text in this box, when i click rtb,...
0
7868
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7792
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8149
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8175
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5674
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5364
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3805
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1403
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1138
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.