Long lines

  • Thread starter =?iso-8859-2?Q?Pawe=B3?=
  • Start date
?

=?iso-8859-2?Q?Pawe=B3?=

I have a few long lines (like these below) and I would like to make them
shorter.
Any ideas how can I do this??


<input size=1 class=\"Unspecified\" maxLength=3 id=SIP1 name=\"SIP1\"
onblur=\"IPcheck(this)\">
<input size=1 class=\"Unspecified\" maxLength=3 id=SIP2 name=\"SIP2\"
onblur=\"IPcheck(this)\">
<input size=1 class=\"Unspecified\" maxLength=3 id=SIP3 name=\"SIP3\"
onblur=\"IPcheck(this)\">
<input size=1 class=\"Unspecified\" maxLength=3 id=SIP4 name=\"SIP4\"
onblur=\"IPcheck(this)\">
 
B

brucie

in post: <
Pawe³ said:
I have a few long lines (like these below) and I would like to make them
shorter. Any ideas how can I do this??

i think this wins weird question of the week
<input size=1 class=\"Unspecified\" maxLength=3 id=SIP1 name=\"SIP1\" onblur=\"IPcheck(this)\">
<input size=1 class=\"Unspecified\" maxLength=3 id=SIP2 name=\"SIP2\" onblur=\"IPcheck(this)\">

delete the spaces
delete size. use css
delete maxlength. (normal form validation should pick it up)
use ' so you don't have to escape " but quote all attributes
use descendent selectors instead of repeating classes
rethink your use of JS
if byte size is an issue when sending use http compression

thats about all i can think of off the top of my head, it would help if
you described what you want to do and why the hell the length of the
markup is an issue.
 
B

brucie

in post: <
delete the spaces
delete size. use css
delete maxlength. (normal form validation should pick it up)
use ' so you don't have to escape " but quote all attributes
use descendent selectors instead of repeating classes
rethink your use of JS
if byte size is an issue when sending use http compression

thats about all i can think of off the top of my head, it would help if
you described what you want to do and why the hell the length of the
markup is an issue.

forgot to say....

if this is just an IP checking thingy then all you need and which is
much better is a single input for the visitor to type the IP so they
don't have to stuff around dealing with 4 separate inputs. KISS
 
M

Mitja

Pawe³ said:
I have a few long lines (like these below) and I would like to make them
shorter.
Any ideas how can I do this??


<input size=1 class=\"Unspecified\" maxLength=3 id=SIP1 name=\"SIP1\"
onblur=\"IPcheck(this)\">
<input size=1 class=\"Unspecified\" maxLength=3 id=SIP2 name=\"SIP2\"
onblur=\"IPcheck(this)\">
<input size=1 class=\"Unspecified\" maxLength=3 id=SIP3 name=\"SIP3\"
onblur=\"IPcheck(this)\">
<input size=1 class=\"Unspecified\" maxLength=3 id=SIP4 name=\"SIP4\"
onblur=\"IPcheck(this)\">

Since you're using JS anyway, you could generate them with document.write()
and a for loop. OK, doesn't make the lines shorter, but reduces overall size
if number of lines is big enough.
 
?

=?iso-8859-2?Q?Pawe=B3?=

in post: <

i think this wins weird question of the week
Is there any way to specify the
-size
-class
-maxLength
-onblur
values for all lines just once???
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top