No problem. :)
For the blank, you can change it like this:
partNum[i] = escape( parts[0] || 'Unspecified' );
qty[i] = escape( parts[1] || 1 );
Then it'll use 'Unspecified' or 1, respectively, if they're blank.
On Oct 8, 6:09 am, "robert...@gmail.com" wrote:
> Thanks again to James
>
>
Thanks again to James
Figured this easy one out myself:
just changed:
for (var i in rows) {
var parts = rows[i].split(' ');
partNum[i] = escape( parts[0] );
qty[i] = escape( parts[1] );
if(qty[i]=="undefined"|qty[i]==""){qty[i]= 1};
}
On Oct 8, 9:12 am, "robert...@gmail.c
James - This is great!!! - thanks so much for the example.
I am posting your code it here for reference...but I have one
additional question.
I noticed that if the user puts a space after the part number but no
qty, then the querystring returns nothing.
If the user puts nothing after the part nu
I've set up a sample page on JS Bin:
http://jsbin.com/oqeco
Check the source for the code.
On Oct 7, 2:38 am, "robert...@gmail.com" wrote:
> It seems straight forward but I still need some advice. I have this so
> far just to see if I can split the array twice...but it is not working
>
> $(docu
It seems straight forward but I still need some advice. I have this so
far just to see if I can split the array twice...but it is not working
$(document).ready(function() {
$("#GetData").click(function() {
var string = $('#PartNum').val().replace(/(\r\n)/g, "~");
var group = string.split('~');
It should be fairly straightforward.
Get the content of the text field: $("PartNum").val();
Use the split() function to split each line by "\n" (return).
Then for each of those lines, split it again by " " (space).
(Store all of these in an array(s).)
Then you can use the join() function to add ",
6 matches
Mail list logo