Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Halfbreed nightmare (VBS & JS)

Status
Not open for further replies.

Caradog

Programmer
Jun 28, 2000
73
GB
Let me see if I can explain this.

OBJECTIVE: I need to write a large about of HTML formatted text to a file stored on a web server. I am using VBS FileObject to do this with no problem. The data being written to the file is entered via a standard form. However....

PROBLEM 1: Posting this data to the next page where it is processed and written to the file can sometimes cause a problem becuase the amount of data being passed via POST or GET is too much for teh URL storage space. The data length WILL be large. How much data (characters) can the URL header hold froma post/get?

IDEA: Instead of posting the data, when someone hits teh submit button, immedaitely write the data to the file (from the same page) WITHOUT the need of posting it and redirect to confirmation page after completion.

SOLUTION: Use JS onClick or onSubmit to fire off a JS procedure since EVENTS cannot be handled by VBS. JS procedure (and here the fun starts) calls a VBS procedue (eek) like so:

<language = &quot;javascript&quot;>
function WriteHTML(){
document.write('<% Call WriteHTML_VBS(DATA) %>');
}
</script>

PROBLEM 2: Since all VBS code is interpretted and executed line by line in 1 pass (ok, legally written VBS pages with subs/functions are ok), when it reaches the JS procedure it immedately runs the VBS code thus running the VBS procedure completely ignoring the rest of code on teh page without allowing the user to press the submit button on the form.

So, anybody out there know a soluton to PROBLEM 1 or PROBLEM 2???

- Jay. Jace Hayman
jason.hayman@virgin.net
 
GET has a limit of 1k or 4k or some such, but I wasn't aware of POST having any limits.
Are you trying to have a large blob of text input using an <input type=&quot;text&quot; /> tag, or a <textarea></textarea> tag?
codestorm
Fire bad. Tree pretty. - Buffy
Hey, I'm operating on a limited mental budget here.
<insert witticism here>
 
Yeah, it's a textarea object. Jace Hayman
jason.hayman@virgin.net
 
We've used POSTs with data up to 4K+ without a problem to handle online scholarship application data for a state university. Is your data going to take up more space than that?
 
And you're not trying to pass Form AND QueryString at the same time, are you (I'm pretty sure that doesn't work)?
(
i.e. you couldn't have something like
<form method=&quot;post&quot; action=&quot;page2.asp?&quot; + ...
)
codestorm
Fire bad. Tree pretty. - Buffy
Hey, I'm operating on a limited mental budget here.
<insert witticism here>
 
Posting does work fine, I tested it yesterday, my problem is I cannot use the post option becuase I am using JavaScript design on mode (you can add bold, italic and underline effects to text withiut needing to know the HTML tags just like in Word etc - perfect for novices) to edit text from a blank HTML web page then grabbing that data using inner.html command. The only way at first I found of passing the data to the otehr side was by using &quot;location.href='nextpage.asp?data=' + varaible_containing_data&quot;. ANd that's where the problem was. Hhhmmm, maybe I could have fired off the data as a hidden field....anyway...

So what I have done now is to fire off JS when the submit button is pressed and saved out teh data as cookies (the data is automatically split into managale sized cookies as needed) then recompiled on the other side using VBS Request.Cookies ready for processing etc.

This solution seems to be working well and seems to be quite scaleable. Jace Hayman
jason.hayman@virgin.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top