473,406 Members | 2,259 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Can JavaScript pass data via the POST method?

ronverdonk
4,258 Expert 4TB
I hope someone can show me the right direction for solving my problem.

I have program where a user can enter text in a <textarea>.
I want to give that user the possibility to have a pre-look at how his entered data looks at an html screen.
I want to show him that in a separate window.
So I use the JavaScript window.open function, passing it the text-processing program and the text that the user has entered so far. For this I use the following code
Expand|Select|Wrap|Line Numbers
  1. function OpenWindow() {
  2.   var text = document.MyForm.formtekst.value.toString().replace(/\n/g ,'<br>');
  3.   hello=window.open('disp_formtekst.php?naam=pass&v=' + text, '');
  4. }
The problem is that the maximum size for a Windows url is 2083 bytes. So when the user types more text then that amount, the string is cut-off at byte 2083.
I understand that using a POST method allows me to pass more then 2083 bytes.
My question is: can anyone point me to a solution that allows me to pass more then 2083 bytes in the window.open function?

Thanks in advance for any suggestions.

Ronald :cool:
Sep 15 '06 #1
2 7402
Banfa
9,065 Expert Mod 8TB
Does it have to be in a separate window?

I do a similar thing but just display the text in a div, I use the onchange handler to update the div as the user types.

If it does have to be in a separate window then can you

Open the Window without putting the text on the url
Use Javascript and the returned value of Window.open to write the text directly to the body of new window.

P.S. Hey you're an expert you're meant to know everything already :D
Sep 15 '06 #2
ronverdonk
4,258 Expert 4TB
Yes it has to be a separate window and I have to pass the data to the text-formatting (disp_formtekst.php) routine.
It works perfectly well as long as the data in the GET does not exceed 2083 bytes (the Windows GET string limitation).
Using CURL is no option, because there is no JS-CURL binding.

That is why I asked if there would be a way to POST the data via JavaScript.

Ronald :cool:
Sep 16 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: SuperPippin | last post by:
Hello all ! I am a bluebit in JavaScript. I would like to write a little program to read data in a MySQL database. What do I need ? Is there a specific "JavaScript Include" to make this work ?...
3
by: Nath | last post by:
Please help!? I am new to writing html, javascript, pretty new to MySQL but quite proficient at writing Perl and i'm a quick learner. I am building a database driven website and i am a little...
6
by: nate | last post by:
Hello, Does anyone know where I can find an ASP server side script written in JavaScript to parse text fields from a form method='POST' using enctype='multipart/form-data'? I'd also like it to...
5
by: Jay | last post by:
Hi, Does anyone know if you can do an HTML POST to a plain html file using javascript to receive and parse the parameters, instead of using asp, php, or a plain-old cgi program? Thanks, Jay
13
by: monomaniac21 | last post by:
hi i want to be able to trigger a javascript style popup alert in php (i want a message displayed on the actual page) is this possible?
27
by: Chris | last post by:
Hi, I have a form for uploading documents and inserting the data into a mysql db. I would like to validate the form. I have tried a couple of Javascript form validation functions, but it...
9
by: misdst23 | last post by:
Hi, I know I can call a static java method within javascript by using the <% ... %tags. But how can pass a javascript variable ? function thefunction() { var = javascriptvariable ;
3
by: anthonybrough | last post by:
I have an asp page that has a form to collect user data in a form. when the user clicks submit the input is validated. If any fields are not acceptable the user clicks on a button to go back to...
4
by: =?Utf-8?B?R1ROMTcwNzc3?= | last post by:
Hi Guys, thanks for your help yesterday, I've got one more question, then I think I'm done for now,... Is it possible to insert recordset data in a javascript, for instance I have a javascript...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.