473,788 Members | 2,905 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 15060
"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
19314
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 until the counter is 4 and then add a zero in between and thru the whole file? Thanks, Garry
1
2264
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 the info). The complex data type is similar to what I'm trying to do so I've been following that as...
10
4894
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: newOpt=document.createElement('OPTION'); newOpt.id='optKeyword'; newOpt.label='Keyword';...
11
2295
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
1572
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
2656
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
15882
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 ************** System.Runtime.InteropServices.COMException (0x80020008): Bad variable type. at...
6
1413
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
19941
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
2439
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, focus is changed from box to rtb, also cursor is placed below this box. Also I want that when I save...
0
9498
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10364
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10172
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9967
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8993
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7517
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5398
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3670
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.