Heinz Stapff 0 Junior Poster in Training

I thought there was a Class array of permited Ajax queries that prevented access to the site even if they had your password? Even an array of permited script files might help. Any advice on demonstration articles addressing these arrays would be appreciated!

Heinz Stapff 0 Junior Poster in Training

OK. I have an Ajax getproduct() function that calls getproduct.php page with the id of li tag elements from multiple uls in #sidebar div. The id of each li tag references a table in the database as '$q=$_GET["q"]'. All the rows in the tables called are the same and each contains a field called 'sold' which is empty. When The client purchases an item from a category / ul tag that only has one original item the database field for that item/sold has to be updated so that that item and row is echoed as sold!. The idea being that the item/row will not be removed from the database until confirmation or receipt of the item by the client. Other clients will be able to view the item sold but won't be able to purchase it for some time untill the purchaser receives the item.

I'm guessing I'll have to add a new Ajax updateproduct() function that calls updateproduct.php. I've added 'Sold!' to the 'sold' field and can see the result echoed and have bookmarked the sql as 'updatesold' and can create the updateproduct.php query. The problem is that the echoed row of the sold item contains select quantity tag with options length 1 that still shows up as 1 when another client downloads the page as well as the button still having innerHTML of 'Buy Now!'. The purchasers select quantity options[0]is converted to 'Sold!' and that buttons innerHTML shows up as 'Sold!' but the next client won't because only …

Heinz Stapff 0 Junior Poster in Training

OK. I have it working better. I had to call the function 'counter()' twice, once at the begining of the onclick then at the end. It seems to work like a dream now. Hope I can pass the array.join in the Get httprequest!!!

Heinz Stapff 0 Junior Poster in Training

:confused: Not sure why this function works the first time but doesn't the second or third time. Any advice greatly appreciated. This is called with ul li tag onclick which sends an ajax get call to the database so the array can only contain upto 3 matching indexes. I should be able to urencode the array.join(' ') and send it to the server for pagination technique with ajax Get request, unfortunatley after the first round the array.join will produce 'art' 'art' 'silver'. Which I could break down on the server side with the php file but I would preffer that the array arrived as per the function. ie.
eather of the following

  • 'art'
  • 'art' 'art'
  • 'art' 'art' 'art'

not

  • 'art'
  • 'art' 'silver'
  • 'silver' 'art' 'silvergold'

Function Counter()

function counter()
{
if(count.length==1)
{
return;
}
else if(count.length==2 && count[0]!==count[1])
{
count.shift();
alert(count.join(' '));//Demonstrates flaw
}
else if(count.length==3 && count[0]!==count[1])
{
count.shift();
alert(count.join(' '));
}
else if(count.length==3 && count[1]!==count[2])
{
count.shift();
count.shift();
alert(count.join(' '));
}
else if(count.length>3)
{
count.shift();
alert(count.join(' '));
}
}

Not sure why it doesn't work beyond first time arround:eek:. Thanks again for any advice.

Heinz Stapff 0 Junior Poster in Training

confused: Not sure why this function works the first time but doesn't the second or third time. Any advice greatly appreciated. This is called with ul li tag onclick which sends an ajax get call to the database so the array can only contain upto 3 matching indexes. I should be able to urencode the array.join(' ') and send it to the server for pagination technique with ajax Get request, unfortunatley after the first round the array.join will produce 'art' 'art' 'silver'. Which I could break down on the server side with the php file but I would preffer that the array arrived as per the function. ie.
eather of the following

  • 'art'
  • 'art' 'art'
  • 'art' 'art' 'art'

not

  • 'art'
  • 'art' 'silver'
  • 'silver' 'art' 'silvergold'

Function Counter()

function counter()
{
if(count.length==1)
{
return;
}
else if(count.length==2 && count[0]!==count[1])
{
count.shift();
alert(count.join(' '));//Demonstrates flaw
}
else if(count.length==3 && count[0]!==count[1])
{
count.shift();
alert(count.join(' '));
}
else if(count.length==3 && count[1]!==count[2])
{
count.shift();
count.shift();
alert(count.join(' '));
}
else if(count.length>3)
{
count.shift();
alert(count.join(' '));
}
}

Not sure why it doesn't work beyond first time arround:eek:. Thanks again for any advice.

Heinz Stapff 0 Junior Poster in Training

OK. I'm learning. I have a side bar with pseudo links(no a tags)ul li elements that automate httprequests nicely. They call different db tables to a display div on the index page. Right now the tables are small and a javascript function deliniates the last row echoed as 'Last Item' in the HTML div that recieves the responseText. Now if the db table queried has more than 20 rows or the limit I would like the client to be able to click 'Last item' span tag to recieve the next rows in the db table and if there are no more rows in that table act as though the next 'li' or 'ul li' element was clicked. I presume that an array of the 'li' elements called 'products' should be created and that next sibling of that array can make the next httprequest when the 'Last item' span is clicked on. How to test for the limit of rows and ensure the correct response in that array is the problem.
Any advice or direction greatly appreciated! This maybe an Ajax or Dhtml question?

Heinz Stapff 0 Junior Poster in Training

Hey Guy's,
back again. Listed this one on WebDeveloper.com but couldn't quite get it solved. I couldn't upload an mp4 video file to clarify the massive HTML file to show what was going on so I'm checking to see if DaniWeb uploads the file before I post the script and CSS. hOPEFULLY DaniWeb handles the upload.

         Looks like the MP4 video file isn't being uploaded. Maybe permision has to be granted by the forum administrator? It would help a lot with this post as it simplifies a lot of the html speculation without overloading the post code etc.
Heinz Stapff 0 Junior Poster in Training

OK. I asked just about every where about the syntax of the name of the card holder as held in the magnetic strip commonly referred to as 'Track #1' and the way it would be stored in the new smart card chips. Mostly the banks are rightly concerned that any such query ranks as a fraudulent endeavor and refuse to give out such information at all. The International Card Manufacturers Association www.icma.com is equally secretive and only gives information to it's members who are fully invested in the promotion and development of new technology. Their on line magazine as yet has no archive search ability as for sure the exact subject may very well have been addressed by one of their many experts in the field. The only information that I could obtain showing the name of card holder held in track #1 of a magnetic strip card had to do with a police inquiry into fraud related to hotel room card keys in which the police had used wireless devices and software to read cards and the name of the card holder stored on track #1. Inadvertently they had read the credit card info as well as the hotel room key cards so rights of privacy where called into question and the investigation itself was investigated revealing the name of card holder in the track#1 as all uppercase A-Z with each name/word delimited by '\' only. Unfortunately this did not reveal the case for "O'BRIEN" and the …

Heinz Stapff 0 Junior Poster in Training

Hey Troy III it isn't clear but appears that the name value excludes any other characters than A-Z for the Embossed Name on the card. So the question I have still is, are these examples correct. Even though validation is done on an exact match bases? It would be nice to know the exact pattern to match.

  1. Edward Peter van Der Saar= EDWARD P VAN DER SAAR?
  2. Ronald Paul MacCdonald= RONALD P MACCDONALD?
  3. Ronald Paul Steven MacCdonald= RONALD P STEVEN MACCDONALD?
  4. Ronald Paul Steven David MacCdonald= RONALD P STEVEN MACCDONALD? DAVID not permitted?
  5. Patrick Peter O'Brien= PATRICK P OBRIEN without " ' "?
  6. Celebrity card names with additional characters & symbols can't be used on line?

I have to confirm all of this with my buddy in the credit card department at my bank before I proceed. Any body else knowing differently should also feel free to chirp in. Thanks for any consideration in advance.

Actually the number of names in a name embossed on the card has not been determined and probably relies on the total string length which doesn't account for Initializing the middle name as in 'John P Smith'. This caused me to believe that only three names where permitted which didn't account for 'Edward Peter van Der Saar' etc.

paul_wilkins at Sitepoint.com provided this info on Credit card magnetic strips http://www.abacus21.com/Magnetic-Strip-Encoding-1586.html

Heinz Stapff 0 Junior Poster in Training

that's all irrelevant since legally names and words may contain double letters in one and in alternate case like Cc, cc, too, but not or never Ccc, or ccc+, so you don't need to check or reject doublets, but triplets. My secondary regexp will take care to eliminate triplets of user input, whereas the primary one will do more than 90% of all cleaning required.

Either way no matter what you add to this, the only thing you may achieve is to lessen input errors, -which in the end [as already pointed out on my previous posts] may, or may not match with existing valid card names. -You can however achieve to store names which (at least theoretically) may belong to real individuals with cards.

Have fun

HEY TROY III I ALSO REALIZED THIS AND POSTED ON SITEPOINT.

paul_wilkins Just realized

Please enter your name as shown on credit or debit card.

Excludes all lower case alpha input of a-z! All are upper case on mine and probably all other cards. In any case the following didn't work on the 'cc' in McCdonalds anyway.

function Caps(str)
{	
var a=str.split(' ');//removed toLowerCase
for(var i=0; i<a.length; i++)
{		
ch=a[i].charAt(0);//Probably needs a regex?
C1=a[i].charAt(1);
C2=a[i].charAt(2);		
a[i]=a[i].replace(ch, ch.toUpperCase());
if(C1=='c'&&C2=='c')
{
a[i]=a[i].replace(C1, C1.toLowerCase());//becomes lower case 'c'
a[i]=a[i].replace(C2, C2.toUpperCase());//remains lower case 'c'
return a.join(' ');
}
else
{	
return a.join(' ');
}
}
}
function nCaps(name)
{	
var f=document.getElementById ('name');	
if(f) 
{ 
f.value=Caps(f.value);
}
}

function namec()
{
nCaps();

Question, if a persons name …

Heinz Stapff 0 Junior Poster in Training

Troy III It's starting to look like you maybe right.

var AZ=/^([a-km-z])\1/i;
//this prevents L from testing for repeated sequential as in 'Lloyd'

I was looking for a regex that found repeated sequential 'cc' and changed it to 'cC' for Scoties like McCdougle that could be added in the final 'else' statement

var cC=/if value contains cc second c = C/; //REGEX??
else
{
brq.innerHTML='Thank you '+name.value.match(cC)+', card verification pending.';
name.value=name.value.match(cC);//TO FORCE THE OUTPUT?
name.style.color='#2c3664';
return true;
}
}
Heinz Stapff 0 Junior Poster in Training

Yeah I'd have to permit the third character of any of the names array strings to be upper case as in McCain which could be avoided by taking the toLowerCase out completely and make most of this post redundat unless I avoid the 'elegant' and force the sequentially repeated character class with regex/pattern.

Any suggestions appreciated:'(;)

Heinz Stapff 0 Junior Poster in Training

paul_wilkins also pointed this out

How about where the name is empty, when people have only one word names for themself, such as Madonna or Cher.

Which means to test the var first I need to change if names less than 2 to equals 1 and come up with a none empty response?

Heinz Stapff 0 Junior Poster in Training

Caps function.

/*thanks to Airshow at dani.web and modifications by OMA*/

function Caps(str)
{	
var a=str.toLowerCase().split(' ');//OMA added toLowerCase()?	
for(var i=0; i<a.length; i++)
{		
ch=a[i].charAt(0);	
//add var ch2=a[i].charAt(2); would add the upper case	to all
a[i]=a[i].replace(ch, ch.toUpperCase());
}	
return a.join(' ');
}

function nCaps(name)
{	
var f=document.getElementById ('name');	
if(f) 
{ 
f.value=Caps(f.value);
}
}

function namechange()
{
//name.value.toLowerCase(); avoided
nCaps();

So I guess that would have to be written in a regex or pattern to allow the third character of the last name to be upper case!
The Scots have money to.

Heinz Stapff 0 Junior Poster in Training

Troy III Wow again! The single Quote " ' " being permitted? Which of course is a legal card name character. I really have to add that one as no punctuation at all is presently permitted. Now I have to check and see if " ' " works with

//except only alphabetical characters in name strings
var alpha=/^[a-zA-Z]+([\s][a-zA-Z]+)*$/;
//except alphabetical characters and single quote like so?
var alpha=/^[a-zA-Z']+([\s][a-zA-Z']+)*$/;

Prevent 'Jjohn P Smith' may not be possible as paul_wilkins suggested ass it would prevent 'Lloyd P Smith'. Unless I had a list of names that had two sequential letters to compare which two letters to allow!

Case insensitive search at beginning of name for one sequentially repeated alpha.

//will prevent 'Lloyd P Smith' with this
var AZ=/^([a-z])\1/i;
//Prevent 'Llloyd P Smith' with this 
var AZ=/^([a-z])\[B]2[/B]/i;
//and I can write 'Error!' to the input value! Not "Please check spelling"

A list of names with double sequential letters would provide the letters that could be added or permitted with a not group in the regex?

//not 'l' for Lloyd or 'c' for McCain etc.
var AZ=/^([a-z][^l|c])\1/i;

Actually "McCain" breaks the automated first Character to upper case after the string is set to lower case? For sure they are legal card names.

Heinz Stapff 0 Junior Poster in Training

stultuske
Thanks again, your input saved me and my client a whole school of problems though I'm not sure the special charachters are permited on merchant credit or debit cards, they might very well be. Paypals and Verisign etc. confirm or deny the purchase made on the card and the site supplies the cardholder information to them so an alphabetical field would be insufficient for any card names with special characters?
Originaly I was cutting out first and last name inputs, avoiding concacting and exsessive database fields etc. while maintaining direct functionality. I'm guessing I won't be shooting the client in the foot by using the alphabetical only field but it would be good to know what percentage of card holders have cards with names that have special characters.

Heinz Stapff 0 Junior Poster in Training

paul_wilkins at sitepoint.com got the pattern/regex right now I can test both A-Z followed by a-z match with i flag and a-z repeated more than twice. I should take his advice as well and not pass 'Error!' to the input value but suggest they make a spelling check. 'Jooohn' is an error, so is 'Jjoohn' but 'Lloyd' is not an error.

Heinz Stapff 0 Junior Poster in Training

paul_wilins at sitepoint.com had this to say

I had said:

In the end I think you're right. Eg. Lloyd and others would be excluded if what I was trying to do was accomplished. here are the two patterns I was trying to test with.
var AZ=/([A-Za-z])\1{1,}/;//couldn't figure out the correct syntac for A-Z followed by a-z matching
var az=/([a-z])\1{2,}/;

For the sake of completion, it seems that no regular expression can capture an uppercase followed by the same lowercase letter, unless you brute-force a solution with:
/^(Aa|Bb|Cc|...|Xx|Yy|Zz)/

A more elegant solution might be to do a case-insensitive check of the first two letters
/^([a-z])\1/i

Where ^ forces the regular expression to match at the first character, (...) captures a group or in this case, one character, \1 repeats what was found in the captured group, and the /.../i with the i flag makes it a case-insensitive search.

That won't guarantee that they follow the letter casing that you need, but if there is other code that deals with the casing then this would do the job.

You could also allow multiple initial letters, but just display a warning about it to let the user know about the situation, in case they have to correct things there, but allow them to submit it anyway.
"Name starts with duplicate characters. Please check that it is spelled correctly" for example.

Heinz Stapff 0 Junior Poster in Training

stultuske Got it, if length less than 2? Was it acctualy the name on your card? Does anybody have a two word name on their card?

Heinz Stapff 0 Junior Poster in Training

stultuske Interesting point. I took it for granted, again that all card holder names consisted of 3 words minimum. Could you show me exactly how your name appears on your card?
Troy III once again you where correct about alerting the unaltered string but I had forgotten to mention that I added a function that automated the input value automatically so the alert would read 'John P Smith'.
Now that stultuske pointed out that a valid card name can have just two names/words I can change that if to //if(names.length<2)
easily enough. In any case the original thread was about matching or testing against patterns and I was stumped trying to test A-Z against matching sequential a-z charachters ie. 'Jjohn P Smith' vs 'John P Smith'. paul_wilkins at sitepoint.com pointed out that what I was trying to do would exclude names like 'Lloyd' which means that it's up to Verisign or Paypals etc. to validate the card name and my concern was over weighted and only relevant to the name stored on the house database. I didn't want the usual first and last name just one name that matched the one on the card!

Heinz Stapff 0 Junior Poster in Training

Troy III Your right guy but I'm realy into it right now and I'm already a week late. Turns out that //n.split(' ').join(''); did produce the correct //alert(n)= 'aaaaa p cccc'

Heinz Stapff 0 Junior Poster in Training

Troy III One draw back is that AAaab B CCCccd passes so the regex still falls short and should be first letter only one uppercase and followed by more than two lower case letters but I'm guessing that the first uppercase letter should be automated in the array
//var first=names[0].length[0].toUpper(); or regex to set the first carachter to uppercase and the rest to lower and then test the string for more than one Uppercase and more than two lowercase?

Heinz Stapff 0 Junior Poster in Training

Troy III Hey dude you gave the exact resonce sdleihssirhc gave at Sitepoint.com under the same thread title. His responce was exact and an awsome demonstration of instruction complete with jsfidel demo.http://jsfiddle.net/AZ5KB/. Great stuff. Now if I could only login to my webdeveloper.com account everybody might have a chance to view the subject.

Heinz Stapff 0 Junior Poster in Training

Troy III Thanks for the response. I'll check it out. The 'nomilize' function isn't suposed to take out all the space but suposed to reduce multiple spaces to one. I'll run it by itself and alert the value of name input onchange to find out. //name.split('2 white spaces').join('one white space');
In any case I'll find out.

Heinz Stapff 0 Junior Poster in Training

Hey guys,
Name input value should be entered as shown on credit card eg. 'John P Smith'. I'm trying to prevent 'Aaaaa B Ccccccc' being sent to the sever. Any suggestions appreciated. I'm pritty sure the var rep=regex is causing the script to hang on the first if it acctualy finds the lowercase repeated more than 2times and I realy need to check that lowercase isn't repeated sequentialy more than 2 times?

THE HTML

<p id="reply">Please enter your name as shown on credit card.</p>
<input type="text" id="name" name="name" class="required" value=" " \>

THE SCRIPT

//namechange function

function namechange()
{
var n=name.value;
n.split(' ').join(''); //get rid of extra white space;
var names=new Array();
names=n.split(' '); //set array delimeter ' ' to space
var first=names[0]; //also tried var first=names.slice(0,1);
var middle=names[1]; //also tried var middle=names.slice(1,2);
var last=names[2]; //also tried var last=names.slice(2,3);
var rep=/^[a-z].{3}$/; //if lowercase alpha repeated 3 times word isn't name need sequential regex!
if(names.length<3) //check that input isn't less than 3 words long ie. 'John P Smith'='John Smith'
{
reply.innerHTML='Your name must be 3 words long eg. John P Smith.';
name.value='Error!'; //lower case 'r' repeated 3 times?
name.style.color='red'; 
return:false;
}
if(names.length>3) //make sure input value not 'John P Smith Jr'
{
reply.innerHTML='Your name must be 3 words long eg. John P Smith.';
name.value='Error!'; //lower case 'r' repeated 3 times?
name.style.color='red'; 
return:false;
}
if(first.match(rep)) //check that lowercase not repeated 3 times should be sequential?
//once this gets picked up the reply remains the same onchange even if …
Heinz Stapff 0 Junior Poster in Training

One more try? I've been trying to manipulate the login form with the xmlhttp.responseText written to a p tag id="loginrequest". I know the three responses I expect, that do work. I even wrote them to an array and called the last member of the array added with .push using .split(-1) but checklogin()/response handler will alert the innerHTML of 'loginrequest' or the .split(-1) of the array and still ignores 'if(loginrequest.innerHTML==' Something'){//do something}if(loginrequest.innerHTML=='Something Else'){//do something else}. The separate ifs are supposed to reveal extra form fields but don't.
1.)For a new member ie. not found on the db, 'loginrequest' reads, 'Not a member? Please register to submit your order.' A confirm password input should appear.
2.)For correct login and wrong password, ie. members login found but password is wrong, 'loginrequest' reads, 'Your password is wrong, you have 3 more attempts to get it right.' No other form fields appear until the input is entered correctly. If the third attempt fails a link should appear with id='emailpass'.
3.)For members found ie. when both login or password is found, 'loginrequest' reads, 'Welcome back " . $row[2] . ". You may change relevant items.' 3 links allowing them to change their password, billing and shipping info.

This appears to be standard site login, so the question is, "Can I use the responseText, either stored in an array or directly from the p tag to alter the form by checking against the innerHTML of the p tag or the value.slice(-1) of the …

Heinz Stapff 0 Junior Poster in Training

OK. Thanks for the advice? 'Search: "Manipulating Form elements with xmlhttp.responseText" or "Handling xmlhttp.responseText" would have been good advice if the searches where not so convoluted with cryptic scenario solutions like this statement. At least it would have pointed me in the right direction! It makes me wonder whether the geniuses can actually speak English as their demonstration and communication skills appear to be left wanting'.
To others that suggested that posting to multiple forums "won't earn you friends or answers!" I will say that I have one too many friends already but I lack the education needed to enhance future prospects and that is why I spend my 'extra' time in multiple forums searching, not just for answers and certainly not for 'friends' but for 'direction' and 'education'!
Given that the current geniuses seem to lack the ability to grasp this simple concept, 'free education for all who are willing to put in the time to be educated', I've felt like it is some kind of secrete technology that others don't want to share and that I should throw in the towel.
Then I realize that that is the true power of the web, 'You can't hide a lit candle in a hay stack'.:(

THEFOOL a.k.a HEINZ PAUL STAPFF.

Heinz Stapff 0 Junior Poster in Training

SethHall your right, I aready changed it and got two variables into the getmembers.php like so.
getmembrs.php

<?php
$login=$_GET['login'];
$pass=$_GET['pass'];//line 3 Error?
$link=mysql_connect("localhost","root","root")or die(mysql_error( ));
mysql_select_db("mydb",$link) or die(mysql_error( )); 
$query=mysql_query("SELECT * FROM members WHERE login='".($login)."' AND pass='".($pass)."'")or die(mysql_error());
while($row = mysql_fetch_array($query))
{
echo "Welcome back " . $row['name'] . ". You may change relevant items.";
}
mysql_close($link); 
?>

Now I need to check for 'if (mysql_num_rows($result) == 0)' so I can return a different respnceText with echo.
Something Like This

<?php
$login=$_GET['login'];
$pass=$_GET['pass'];//line 3 Error?
$link=mysql_connect("localhost","root","root")or die(mysql_error( ));
mysql_select_db("bwi",$link) or die(mysql_error( )); 
$query=mysql_query("SELECT * FROM mexicalians WHERE login='".($login)."' AND pass='".($pass)."'")or die(mysql_error());
$num=mysql_num_rows($query);
if($num == 0)
{
echo "Sorry, No match found, please try again or register"//might be " " empty string?
}
elseif($num == 1)
{
echo "Welcome back " . $row['name'] . ". You may change relevant items.";
}
mysql_close($link); 
?>

Then of course I have to test the xhtml.responceText some how in the ajax call which I have no idea how to do, though I have a feeling it involves setting a var responce=xhtml.responceText. But how and where to place it in the Ajax call is hurting my head.
Ajax Call

function getmember(){
var responce=xhtml.responceText;
var p=pass.value;
if(p==' '){
lrq.innerHTML=' ';
}
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else{// code for IE6, IE5
xmlhttp=new ActiveXObject('Microsoft.XMLHTTP');
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
lrq.innerHTML=xmlhttp.responseText;
if(responce=='something')//don't have a clue because the name returned by the php
//is the …
Heinz Stapff 0 Junior Poster in Training

Hey SethHall dito!
Gmanat SitePoint.com and webdev1958
at SitePoint.com As I posted at WebDeveloper.com, I'm really struggling here. Please help me if you can. I'm struggling to add multiple variables to a get Ajax call and adding a function that returns a different response if the database values don't match the input values.
I'm going to copy and paste to DaniWeb.com where I have posted under the same title. Thanks for any consideration in advance.
007Julienat WebDeveloper.com. well I'm realy strugling with this. I tried the article syntax to add multiple variables to the getmember.php but I get this error as responce text

Error!

Notice: Undefined variable: _Get in D:\use_ide_1\UniServer\www\mexicali.php on line 3

getmember.php

<?php
$login=$_GET['login'];
$pass=$_Get['pass'];//line 3 Error?
$link=mysql_connect("localhost","root","root")or die(mysql_error( ));
mysql_select_db("bwi",$link) or die(mysql_error( )); 
$query=mysql_query("SELECT * FROM members WHERE login='".($login)."' AND pass='".($pass)."'")or die(mysql_error());
while($row = mysql_fetch_array($query))
{
echo "Welcome back " . $row['name'] . ". You may change relevant items.";
}
mysql_close($link); 
?>

Ajax call

function getmember(){
var p=pass.value;
if(p==' '){
lrq.innerHTML=' ';
}
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else{// code for IE6, IE5
xmlhttp=new ActiveXObject('Microsoft.XMLHTTP');
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
lrq.innerHTML=xmlhttp.responseText;
document.getElementById('pass2list').style.display='none';
document.getElementById('emailpasslist').style.display='none';
document.getElementById('loginrequest').style.display='block';
document.getElementById('changepasslist').className='show';
document.getElementById('continuelogin').style.visibility='visible';
document.getElementById('logincontainer').style.paddingBottom='12%';
//This works all the time even if the password and login don't match

//do I need an if (xmlhttp.readyState==4 && xmlhttp.status==404)

//i.e. when the values doen't match the database values?
}
}
var loginvalue=encodeURIComponent(document.getElementById('login').value)
var …
Heinz Stapff 0 Junior Poster in Training

SethHall
For your consideration, thanks.

007Julien @webdeveloper.com thanks for that, I posted on DaniWeb my thoughts that passing two variables with 'get' method was not possible. You are saying that it is? I guess I'll do some research on Mr. Peter Paul Koch to see if I can get a better understanding of using 'get' with multiple variables which might have been a better title for this post. I used the same post title on Daniweb, and Sitepoint so I'm going to copy and paste this reply to them.

Heinz Stapff 0 Junior Poster in Training

SethHall yes I believe you are right and the getmember.php has been amended by adding the second closing bracket at the end of the else statement though a third one maybe needed. The other problem was that 'get' only provides for a query of one variable. In this case the input value of input id/name 'pass'. I was trying to write an additional variable, the value of the input id 'login' to check that the mydb table members had both 'login' and 'pass' values that matched. I found out that that maybe the limitation of the 'get' method in that it provides a query with only one variable. If I'm wrong, please let me know. The following getmember.php produces this error because of the second variable added to a 'get' ajax call '$num=mysql_num_rows($query);' is not permited with the 'get' method and requiers a form post method when clicking a submit button. I want to validate the member before he sees the rest of the form so there is no submit button shown untill several inputs are validated on the server with the same 'get' method. With the post on several sites I still have some investigation to do as to 'get functions'

<?php
$q=$_GET["q"];
$link=mysql_connect("localhost","root","root")or die(mysql_error( ));
mysql_select_db("mydb",$link) or die(mysql_error( )); 
$query=mysql_query("SELECT * FROM members WHERE pass='".($q)."'")or die(mysql_error());
$num_rows=mysql_num_rows($query);//additional variable not allwed in 'get'?
if($num_row==0)
{
echo "You must register, no such email address was found";   
}	
else if(num_row==1)
{
while($row = mysql_fetch_array($query))
echo "Welcome back " . $row['name'] …
Heinz Stapff 0 Junior Poster in Training

OK. My 'logincontainer is hard coded HTML in the index.html page and is shown when a 'placeorder' button is clicked. The client enters their e-mail address in the only input visible and javascript addevent onchange checks to see if it is a valid e-mail or not. Above the input id 'login' is a span tag id 'loginrequest' which serves as server responceText. When the 'login.value' is a valid email address the second input is made visible id 'pass'. The 'pass' input addevent onchange query's the database with 'SELECT id FROM members WHERE login= '".($login)."' AND pass='".($pass)."'". The problem is

ResponceText span id 'loginrequest'

Parse error: syntax error, unexpected $end in D:\use_ide_1\UniServer\www\getmember.php on [B]line 26[/B]

MyDb Members Table Columns
id|status|started|name|login

Ajax call in index.js

var emailformat=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*\.(\w{2}|(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum))$/;
var lrq=document.getElementById('loginrequest');
var login=document.getElementById('login');
var passwordlist=document.getElementById('passwordlist');
var temail=document.getElementById('temail');//html table cell written to

function logincheck(){
var p=login.value;
if(p==' '){
lrq.innerHTML='Please Enter Your E-mail Address to login and register.';
return false;
}
if(emailformat.test(p)){
lrq.innerHTML='Please enter Your password.';
temail.innerHTML=p;
passwordlist.className='show'; 
return false; 
}
else{
lrq.innerHTML='Please Enter a Valid E-mail address.';
return true;//works
}} 

addEvent(login,'change',function(){logincheck();},false); 

var pass=document.getElementById('pass');

function getmember(p){
if(p==' '){//if 'pass.value' is empty?
lrq.innerHTML=' ';
}
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else{// code for IE6, IE5
xmlhttp=new ActiveXObject('Microsoft.XMLHTTP');
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
lrq.innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open('GET','members.php?q='+p,true);//+p being 'pass.value'? no +e login.value?
xmlhttp.send();
}

addEvent(pass,'focus',function(){lrq.innerHTML='Minimum 8 characters, Maximum 12.';},false);

addEvent(pass,'change',function(){
var e=login.value;
var p=pass.value;
getmember(p);//Ajax call
},false);

getmember.php

1. …
Heinz Stapff 0 Junior Poster in Training

Airshow actually I will be using 'onchange' event of login input which will be visible. When the input is not blank javascript will ensure that a valid email is entered then search the database members table for id that equals the email address if none exists the password and confirm password will be revealed. If they are a member then only the password will be revealed. The client will have to enter their password every time and it will be MD5 and it's cookie will not be saved. If the password and login match the members table then the rest of the forms inputs will be revealed allowing them to make changes to shipping and payment options.

Thanks for your assistance again and I will mark this post as resolved as soon as I get a working example going. DaniWeb does have excelent examples of PHP Login and register Validation:)

Heinz Stapff 0 Junior Poster in Training

Airshow thanks again for the excellent response. Will check it out tomorrow and post back.

Heinz Stapff 0 Junior Poster in Training

Airshow Thanks for the response. OK. so the first two inputs 'login' which is an email address and 'password' are php query database types and the client side javascript security is their format/characters allowed and length?
MD5.js would be run on the password so that even the database record would not be readable but would be run in reverse to match it to the client input but never saved as a cookie? Only the 'login/email' would be readable and saved as a cookie that would launch the database query to match the 'password' input? Is there an example of this process you can direct me to Using PHP or other language with MD5?:-/

Heinz Stapff 0 Junior Poster in Training

Hi Airshow this is 2010 post that I'm trying to mark as resolved. The issue was linking to MD5.js and storing cookies. If I use 'this_session_logincookie_MD5' the security would still be compromised if the client didn't have their own login before accessing the site. The cookie would not be readable itself until the client entered the site and entered their login email address and password. Then if they matched the info on the server the rest of the inputs in the form would be auto filled! They can change the info if they want which will reset the cookies for the next session? Seems far more logical and secure?
Please let me know so I can mark the post resolved? I'm copying and pasting this message as a reply to the post. Hope all is well with you and yours.

Best regards, Heinz Stapff :(

Heinz Stapff 0 Junior Poster in Training

Yeah, I've forgotten how to mark a post as resolved. Most of the other forums have omitted this valuable tool for doing so. Thanks for any consideration. Also I'd like spell check as mine is horrible! I guess IE8 iSpell doesn't work so well like Firefox!

I found iSpell and it works. Sorry about that. I got to admit Firefox automation is simpler.

' Has this Thread Bin Answerd? ' doesn't appear when you are editing? and I presume You click that to mark the thread or Post as 'Resolved'?

Thanks Narue got it

Dito

Heinz Stapff 0 Junior Poster in Training

Yeah, I've forgotten how to mark a post as resolved. Most of the other forums have omitted this valuable tool for doing so. Thanks for any consideration. Also I'd like spell check as mine is horrible! I guess IE8 iSpell doesn't work so well like Firefox!

I found iSpell and it works. Sorry about that. I got to admit Firefox automation is simpler.

' Has this Thread Bin Answerd? ' doesn't appear when you are editing? and I presume You click that to mark the thread or Post as 'Resolved'?

Thanks Narue got it

Heinz Stapff 0 Junior Poster in Training

Hey Taywin how do you mark a post as resolved?:icon_evil: That is a handy post tool that most sites have omited today.

Heinz Stapff 0 Junior Poster in Training

Wow Taywin that got it. God, Allah and Budah bless you! So simple and it was the the third and final '}' closing brace that got all cells of className 'rowsubtotal' to equal the innerHTML of cell id 'subtotal'. This is the script that works.
SCRIPT THAT WORKS

function checksubtotal(){
var subtotal=document.getElementById('subtotal').innerHTML; 
var rowsubtotals=document.getElementsByClassName('rowsubtotal'); 
for(var i=0; i< rowsubtotals.length; i++){ 
if(rowsubtotals[i].innerHTML!==subtotal){
rowsubtotals[i].innerHTML=subtotal;
}}}

function deleterow(a) {
// remove row
var rowsubtotals=document.getElementsByClassName('rowsubtotal');
var row=a.parentNode.parentNode;
row.parentNode.removeChild(row);
var sTotal=sumsubtotal();
checksubtotal(); //Finaly works!!!
EvalSound4();
}

HTML RESULT:)

<tfoot>
<tr>
<td id="subtotal">$ 75.00</td>
</tr>
<tr>
<td id="message">Muchos Mas Gracias!</td>
</td>
</tr>
</tfoot>

<tbody>
<tr class="itemrow">
<td class="rowsubtotal">$ 75.00</td>
</tr>
<tr class="itemrow">
<td class="rowsubtotal">$ 75.00</td>
</tr>
<tr class="itemrow">
<td class="rowsubtotal">$ 75.00</td>
</tr>
<tr class="itemrow">
<td class="rowsubtotal">$ 75.00</td>
</tr>
<tr class="itemrow">
<td class="rowsubtotal">$ 75.00</td>
</tr>
<tr id="dummy">
<td id="client Message">Thank You very Much <b>Taywin</b></td>
</tr>
</tbody>

Thanks again Taywin from DaniWeb.com

Heinz Stapff 0 Junior Poster in Training

Taywin Thanks for the reply. pactor21 from webdeveloper com had already pointed that out. My last post showed the result of the amended function syntax, not staggerd for readability puroses too! Shows that the function only changes the first and last rows inserted and none of the rows in between/middle. So I decided I need to get the for loop to test the innerHTML of each element of className 'rowsubtotal' against the innerHTML of cell id 'subtotal'. if the test proves true then carry on till it doesn't and change the innerHTML of all those that doen't?

SOMETHING LIKE THIS

function checksubtotal(){ 
var subtotal=document.getElementById('subtotal').innerHTML; 
var rowsubtotals=document.getElementsByClassName('rowsubtotal');
for(var i=0; i< rowsubtotals.length; i++){ 
                                          var rowsubtotal=rowsubtotals[i].innerHTML;
                                          var found=test.subtotal;//returns test undefined
                                         } 
           if(rowsubtotal.found){
              return false;                                
                                }
else{ 
     rowsubtotal=subtotal;
     return true; //might stop at the first one found?
    } 
                        }

I'm generally pissed of at having to crunch white space out when staggering functions.

Heinz Stapff 0 Junior Poster in Training

Ok. after opening a brace before the if statement and taking out the else statement thanks to pactor21 at webdeveloper.com, I got the first inserted row and last inserted row containing cells of className 'rowsubtotal' innerHTML to match the innerHTM of cell id 'subtotal' in the table but any rows in between row index 0 and row index -1 or last are unchanged.

The script

function checksubtotal(){ 
var subtotal=document.getElementById('subtotal').innerHTML; 
var rowsubtotals=document.getElementsByClassName('rowsubtotal');
for(var i=0; i< rowsubtotals.length; i++){ //loop only gets first and last
var rowsubtotal=rowsubtotals[i];
} 
if(rowsubtotal.innerHTML!==subtotal){ // may need comparison '!match subtotal' ?
rowsubtotal.innerHTML=subtotal;
} 
}

function deleterow(a) {
// remove row
var rowsubtotals=document.getElementsByClassName('rowsubtotal');
var row=a.parentNode.parentNode;
row.parentNode.removeChild(row);
var sTotal=sumsubtotal();
checksubtotal();//only changes first and last rows cells className 'rowsubtotal' ?
EvalSound4();
}

HTML RESULT

<tfoot>
<tr id="footsubtotal">
<td id="subtotal">$ 75.00</td> 
//all cells of class "rowsubtotal" must have same innerHTML as this.
</tr>
</tfoot>

<tbody>
<tr class="itemrow"><td class="rowsubtotal">$ 75.00</td></tr> 
<!--3rd inserted row at row index 0 innerHTML equals '$ 75.00' or innerHTML of 'subtotal'-->
<tr class="itemrow"><td class="rowsubtotal">$ 20.00</td></tr> 
<!--2nd inserted row at row index 0 innerHTML should be '$ 75.00' but doesn't ?-->
<tr class="itemrow"><td class="rowsubtotal">$ 75.00</td></tr> 
<!--1st inserted row at row index 0 innerHTML equals '$ 75.00' or innerHTML of 'subtotal'-->
<tr class="dumy"><td class="message">Thank You</td></tr>
</tbody>

I'm realy thinking a comparison by match of the innerHTML of 'subtotal' might get the for loop getting all the cells of className 'rowsubtotal' to equal cell id 'subtotal' innerTML. Will check it out.:'(

Heinz Stapff 0 Junior Poster in Training

Taywin yes I know they are there as I setup an addEvent onclick of a utility button that tells me the length of 'rowsubtotals'. Of cource they are not there to begin with and are only there after the rows are inserted. Clicking the button not only tells me how many cells with className 'rowsubtotal' it also tells me how may rows are inserted as there is only one cell with className 'rowsubtotal' per row.

addEvent(document.getElementById('button'),'click',function(){
var rowsubtotals=document.getElementsByClassName('rowsubtotal');
alert(rowsubtotals.length);
},false);
Heinz Stapff 0 Junior Poster in Training

Question Get cells by className to equal innerHTML of cell id 'subtotal'
I'm trying to grab all the cells created with insertrow function and the className 'rowtotal' and get their innerHTML to equal that of a cell with id 'subtotal'. This is a simplified html code of single cell inserted rows:

index.html

<tfoot> 
<tr id="footsubtotal"> 
<td id="subtotal">$ 75.00</td>  
//all cells of class "rowsubtotal" must have same innerHTML as this. 
</tr> 
</tfoot>  
<tbody> 
<tr class="itemrow">
<td class="rowsubtotal">$ 15.00</td>
</tr>  
<!--3rd inserted row at row index 0 innerHTML should be '$ 75.00'--> 
<tr class="itemrow">
<td class="rowsubtotal">$ 20.00</td>
</tr>  
<!--2nd inserted row at row index 0 innerHTML should be '$ 75.00'--> 
<tr class="itemrow">
<td class="rowsubtotal">$ 40.00</td>
</tr>  
<!--1st inserted row at row index 0 innerHTML should be '$ 75.00'--> 
<tr class="dummy">
<td class="message">Thank You</td>
</tr> 
</tbody>

These functions are not working and I'm not sure I can get javascript functions that will.

product.js

function checksubtotal(){ 
var subtotal=document.getElementById('subtotal').innerHTML; 
var rowsubtotals=document.getElementsByClassName('rowsubtotal'); 
for(var i=0; i< rowsubtotals.length; i++){ 
var rowsubtotal=rowsubtotals[i]; 
if(rowsubtotal.innerHTML!==subtotal){ //comparison '!==' ??? 
rowsubtotal.innerHTML=subtotal; } 
else{ rowsubtotal.innerHTML=subtotal; }}//throws syntax error?  

function deleterow(a) { // remove row 
var row=a.parentNode.parentNode; 
row.parentNode.removeChild(row); 
var sTotal=sumsubtotal(); 
//don't know what this is but seems to work??  
EvalSound4(); checksubtotal();
//doesn't work??

Not sure if this is the wrong approach, might have to use a
!match syntax. Any help greatly appreciated :'(

Heinz Stapff 0 Junior Poster in Training

About the new style of Dani Web site. I remain greatfull to those who dedicate thier time to helping others with lesser understanding of valuable education. I would suggest that the fixed footer row is excelent and that it is the appropriate place for members to have a 'Post-Thread' button which should have a select index menu that links to all forums. The days of scrolling to find a button to click should be long gone. HTML layout is everything and the heart of web design. Thanks for all your consideration.

Heinz Stapff 0 Junior Poster in Training

Fang Thanks again. You are right. The problem has to do with the HTML document itself. The generated row contains 9 cells as written in the JS. Unfortunatley the first cell .code dosen't follow the CSS rule width of 10%, instead appearing as 25%+ and sibling cells appear to follow the CSS rules while the row .itemrow itself dose span 100% of the table, the other rows vary in width according to the amount of td/th tags they hold. This means that the document HTML div tags CSS positioning rules are wrong.

I figured this out by setting the back-ground color of .tablecontainer to 'grey' and was amazed that no grey appeared on screen. Then I set .tablecontainer height to 100% and could see that the .tablecontainer 100% width was only 25%+ matching .code width.

CSS rules are strict and only as good as the HTML they support.

Remembering that the HTML was working fine untill I decided to automate 'Scaleing' of elements by changing height values from pixels to percentages I now have to go back through all the CSS rules for each element and change them back to pixel units

Most browsers claim to support height:% values for most elements and apparently the table elements Siblings fall short of these claims and maybe the cause for utilizing nested div tags with display:table-cell; and display:table-row; CSS rules.

'Don't fix it if it is not broken' sounds reasonable but saving your file as a different …

Heinz Stapff 0 Junior Poster in Training

Sorry for the previous thread format.

This is CSS versus HTML. It took me a while to abreviate both and it's
still long. Basicaly #tablecontainer width is not following the style rule.
Can anybody see why?:confused: All the other relative positioned divs do. :mad:

<head>
<title>checkout</title>
<style type="text/css">
body { width:100%; }
#content { position:absolute; left:0; top:4px; width:99.5%; margin-right:4px; }
#tablecontainer { position:relative; left:0%; top:0%; width:100%; height:100% background:grey; margin-top:0px; 
margin-bottom:16px; } /*width not 60% of #content div!!!why???*/
#carttable { position:relative; left:0px; top:17px; width:100%; background:transparent;
font:normal  normal normal 16px/16px "times new roman", arial, courier; border-spacing:0px;
border-collapse:collapse; } /*width varies by row of #tablecontainer div!!!why???*/
#all other divs { position:relative; left:0%; top:0%; width:100%; }
/*are are longer than 100% of #content div. why??*/
</style>
</head>
<body>
<div id="content">
<form name="checkout">
<div id="tablecontainer">
<thead id="carthead">
</thead>
<tfoot id="cartfoot">
</tfoot>
<tbody id="cartbody">
</tbody>
</table>
<div id="submitordercontainer">
</div>
</div>
<!==END OF #TABLECONTAINER==>
<div id="logincontainer">
<fieldset id="loginfield">
</fieldset>
</div>
<!==END OF #LOGINCONTAINER==>
<div id="billcontainer">
<fieldset id="billfield">
</fieldset>
<div id="logbillbuttoncontainer">
</div>
</div>
<!==END OF #BILLCONTAINER==>
<div id="shipcontainer">
<fieldset id="shipfield">
</fieldset>
<div id="logshipbuttoncontainer">
</div>
</div>
<!==END OF #SHIPCONTAINER==> 
<div id="paycontainer"> 
<fieldset id="payfield">
</fieldset>
<div id="logpaybuttoncontainer">
</div>
</div>
<!==END OF #PAYCONTAINER==>
</form>
</div>
<!==END OF #CONTENT==>
<script src="scripts/checkout.js"></script>
</body>
</html>

I guess I'll have to pixel everything?

Heinz Stapff 0 Junior Poster in Training

ardav

The row with the problem is generated with javascript from another window. It is
'Pseudo' HTML the insertRow function works fine. The CSS width on cell[0]/td[0] className 'item' in row className 'itemrow' inserted at row index[0] is the problem.
The HTML for the table on the page dose not mention the afffected row cells.

<div id="tablecontainer">
<form name="formcheckout" id="formcheckout" method="post" action="" onsubmit="">
<table id="carttable" cellspacing="0" cellpadding="0">
<thead id="carthead">
<tr id="header" class="header">
<th id="headcode">Code</th>
<th id="headitem">Item</th>
<th id="headcolor">Color</th>
<th id="headsize">Size</th>
<th id="headprice">Item Price</th>
<th id="headquantity">Quantity</th>
<th id="headcost">Cost</th>
<th id="headtotal">Total</th>
<th id="headclear">Clear</th>
</tr>
</thead>
<!=====================INSERTROW HTML WOULD BE===========================>
<tr class="itemrow"> <!---new tbody.rows[0]--->
<th class="code"></td>
<th class="color"></td>
<th class="size"></td>
<th class="price"></td>
<th class="quantity"></td>
<th class="cost"></td>
<th class="rowsubtotal"></td>
<th class="clear"></td>
</tr> <!---ALL CELLS ARE GENERATED CELL[0].CODE IS 25% NOT 10%???--->
<!=====================BEGINING OF #CARTBODY===========================>
<tbody id="cartbody">
<tr class="dumy"  id="dumy"><!--TBODY.ROWS[0]INSERT POINT OF NEW ROW CLASS .ITEMROW-->
<td class="clientmessage" id="clientmessage">Are you ready to shop?</td>
</tr>
</tbody>
</table>
</br>
<div id="submitordercontainer">
<button type="button" class="button" id="submitbutton" value="">Submit Order</button>
<p class="continueshopping" id="tablecontinueshopping">
<span id="printorder">Print Your Order.</span>&nbsp;&nbsp;
<span id="orderinfo">Change Your Info.</span>&nbsp;
<span id="continueshopping">Continue Shopping.</span>
</p>
</div>
</div>
Heinz Stapff 0 Junior Poster in Training

almostbob
the insertRow works fine and generates 9 cell/td row
className '.itemrow'. The CSS to controll the width of each
cell so that they line up with each header is the problem.
code setattribute axis codehead would be great if the width
of the header row th/cells where duplicated in the tbody
'itemrow' cells.

THE COMPLETE THEAD & BODY CSS??

#carttable {position:relative; left:0px; top:17px; width:100%; background:#ffffff; font:normal normal normal 120%/120% "times new roman", arial, courier; border-spacing:0px;border-collapse:collapse;}

tr { vertical-align:middle; height:24px;}
th { background:#2c3664; color:#666; border-bottom:1px solid #2c3664;}
td { background:#ffffff; color:#2c3664; border-bottom:1px solid #2c3664;}

/*==============HEAD & BODY CELLS===================*/

#header {position:relative; top:0; left:0; width:95.5%;}

#headcode {width:8%; text-align:left; padding-left:2px;
white-space:nowrap; height:24px;}/*NO PROBLEM 8%

.code {width:8%; text-align:left; padding-left:5px;/*PROBLEM 25%
border-right:1px solid black; white-space:nowrap;}

#headitem {width:20%; text-align:left; padding-left:5px;
white-space:nowrap;}/*NO PROBLEM 20%

.item {width:5%; text-align:left; padding-left:5px; white-space:nowrap;}/*PROBLEM WAY OVER TO RIGHT

#headcolor {width:10%; text-align:center; white-space:nowrap;}
.color {width:10%; text-align:center; white-space:nowrap;}
#headsize {width:10%; text-align:center; white-space:nowrap;}
.size {width:10%; text-align:center; white-space:nowrap;}
#headprice {width:10%; text-align:left; padding-left:3px; white-space:nowrap;}
.price {width:10%; text-align:left; padding-left:3px; white-space:nowrap;}
#headquantity {width:10%; text-align:center; white-space:nowrap;}
.quantity {width:10%; text-align:center; padding-left:2%; padding-right:2%; white-space:nowrap;}
#headcost {width:10%; text-align:left; padding-left:12px; white-space:nowrap;}
.cost {width:10%; text-align:left; padding-left:12px; white-space:nowrap;}
#headtotal {width:10%; text-align:left; padding-left:4px; white-space:nowrap;}
.rowsubtotal {width:10%; text-align:left; padding-left:4px; white-space:nowrap;}
#headclear {width:8%; padding-left:2px; white-space:nowrap;}
.clear {width:10%; text-align:center; padding-left:1px; padding-left:1px; background:#2c3664; white-space:nowrap;}

I mixed up pixels and percentages to test both but would …

Heinz Stapff 0 Junior Poster in Training

I set the width of cell[0] by CSS style sheet to 8%
but it renders about 25% and
crunches the other cells to the right?

Pseudo HTML 'code':p

var addcode=itemrow.insertCell(0);//part of insertrow
addcode.className='code';
addcode.appendChild(document.createTextNode(code));

.code {width:8%; text-align:left; padding-left:5px;
border-right:1px solid black; white-space:nowrap;}

/* .code width is about 25% and crunches up the other
td/cells in the row*/:confused: