Go Back   CodingForums.com > :: Client side development > JavaScript programming > Ajax and Design

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 04-28-2007, 07:20 AM   PM User | #1
CstAn
Regular Coder

 
Join Date: Nov 2005
Posts: 148
Thanks: 1
Thanked 0 Times in 0 Posts
CstAn is an unknown quantity at this point
any idea on it? - innerHtml & http request return result

Dear all,

can anyone provide me some idea on how insert html code to a box (fix the height/ like textarea) by javascript?

my problem:
In my program, i had an upload function which allow user to upload an excel file and display out the content.

Can you provide me some idea on how can i read the content and return in few part after the user upload the file? By using "setinterval"?

how can i display the content in a box that had fix height (like textarea)? if the contents more that, a scroll bar will enable and let the user scroll down the contents.

* i m using PHP and javascript in my program. The upload functin was using AJAX for that.

thank a lot.

Last edited by CstAn; 04-28-2007 at 12:58 PM..
CstAn is offline   Reply With Quote
Old 04-28-2007, 05:43 PM   PM User | #2
david_kw
Senior Coder

 
Join Date: Nov 2006
Posts: 1,000
Thanks: 0
Thanked 0 Times in 0 Posts
david_kw will become famous soon enough
I'm not aware of any way that your javascript can have access to a file on the local system without gonig through your server first. So the way I'd probably set it up is to use the input type="file" form to send it to the server then use ajax to poll when the upload is complete and download the bits you want for display.

Maybe someone else knows a better way.

david_kw
__________________

www.eXfer.net
david_kw is offline   Reply With Quote
Old 04-28-2007, 05:56 PM   PM User | #3
CstAn
Regular Coder

 
Join Date: Nov 2005
Posts: 148
Thanks: 1
Thanked 0 Times in 0 Posts
CstAn is an unknown quantity at this point
Quote:
Originally Posted by david_kw View Post
I'm not aware of any way that your javascript can have access to a file on the local system without gonig through your server first. So the way I'd probably set it up is to use the input type="file" form to send it to the server then use ajax to poll when the upload is complete and download the bits you want for display.

Maybe someone else knows a better way.

david_kw
this what i want to do.

i plan had a upload file function and let the user upload the file to server.
* only limit to excel file.

all this process are done with AJAX.

we assume that we had 1000 file of line in the excel file. How can i separate the file and return to user in different time? but the user do not need to execute the function.

for example:
when upload complete, it return 1st 50 line, then continue with next 5 line. But the user not need to execute the process.

and the user jz see the result on the screen and a msg was show to user the process was running.

can any one tell whether & how the javascript can access the local file, if the javascript can done it.

thanks.


how about we can insert a box by using javascript and inside had the contents of the file upload? the box must had fix height and weight as well as can insert html tag....like the textarea.

thanks
CstAn is offline   Reply With Quote
Old 04-29-2007, 09:01 AM   PM User | #4
CstAn
Regular Coder

 
Join Date: Nov 2005
Posts: 148
Thanks: 1
Thanked 0 Times in 0 Posts
CstAn is an unknown quantity at this point
I m using iframe now, but i cant refer to particular text box or textarea in the iframe with dynamic script.

* i assign to each text box / textarea with different name. it assign with a prefix name plus a number count behind.
for example: textBox_1, textBox_2, n etc...


can anyone tell me how can i refer to particular text box?

i can direct refer to it with:
document.iframe.textBox_1.value...but i cant hard code it. cause the content are dynamic.

thanks.
CstAn is offline   Reply With Quote
Old 04-29-2007, 05:29 PM   PM User | #5
david_kw
Senior Coder

 
Join Date: Nov 2006
Posts: 1,000
Thanks: 0
Thanked 0 Times in 0 Posts
david_kw will become famous soon enough
If I understand your question, I think you can do this

document.iframe.textBox_1.value

could be done with

var box = 1;
document.iframe['textBox_' + box].value

then you could change the value of variable box as needed to address different ones.

david_kw
__________________

www.eXfer.net
david_kw is offline   Reply With Quote
Old 04-30-2007, 04:38 PM   PM User | #6
CstAn
Regular Coder

 
Join Date: Nov 2005
Posts: 148
Thanks: 1
Thanked 0 Times in 0 Posts
CstAn is an unknown quantity at this point
thanks david_kw.


i faced problem again.

isn't anyway can we do like using Iframe?

we cant call the function that place outside the iframe rite??
*parent window.

isn't anyway can do like the iframe, that we can fix the height of box?
CstAn is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:33 AM.


Advertisement
Log in to turn off these ads.