473,624 Members | 2,217 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Form submit IE Error

3 New Member
Hello everybody:

This is my first thread in here. I readed a lot of good problems and solutions in this webpage. Right now im having troubles with one form submit in IE.

Here's the thing. I'm trying to generate a PDF in PHP, i'm using mPDF to show the html code with css. I sent through Post the hmtl code with a javascript form like this.

Expand|Select|Wrap|Line Numbers
  1. function exportPDF(prosjekt,url){
  2.    var poststr4=new Array();
  3.    poststr4["prosjekt"] = prosjekt;
  4.    var html = openRepres(prosjekt);
  5.    poststr4["html"]="<head></head><body>"+html+"</body>";
  6.  
  7.    //---------------POINT 1--------------//
  8.    document.write(poststr4["html"]); 
  9.  
  10.    var method = "post"; 
  11.    var form = document.createElement("form"); 
  12.    form.setAttribute("method", method); 
  13.    form.setAttribute("action", url); 
  14.    for(var k in poststr4) { 
  15.         var hiddenField = document.createElement("input");
  16.         hiddenField.setAttribute("type", "hidden"); 
  17.         hiddenField.setAttribute("name", k); 
  18.         hiddenField.setAttribute("value", poststr4[k]);
  19.         form.appendChild(hiddenField); 
  20.     } 
  21.     document.body.appendChild(form);
  22.  
  23.     //----------------POINT 2-----------//
  24.     form.submit(); 
  25.  
  26.     document.body.removeChild(form);
  27. }
In this code, when i show the code in POINT1 with document write, the table that i sent is in this way:

<table border="1" class="wind">.. .

However, when i send the form to the URL in Point 2, the code that arrives is like this:

<table border=\"1\" class=\"wind\"> ...

So what it does the form.submit is putting a slash in every " that is sent.

Why is this?The worst thing is that it hapenned to me after changing my server from Apache to IIS 6.0 (I dont like IIS, but is mandatory for the job)

Thank you!
Jul 23 '10 #1
4 2167
Dormilich
8,658 Recognized Expert Moderator Expert
Why is this?
that’s a setting in your php.ini. namely magic_quotes_gp c. if that should be disabled, either the server or IE is applying the backslashes. easiest workaround for that: stripslashes().
Jul 23 '10 #2
thenanox
3 New Member
@Dormilich
ok, i changed the PHP.ini putting off that attribute, restarted the server and now works perfect:)

REALLY thank you, i was really anoyed searching for the solution
Jul 23 '10 #3
Dormilich
8,658 Recognized Expert Moderator Expert
Note: magic_quotes_gp c is deprecated as of PHP 5.3.0 and will be removed in PHP 6.
Jul 23 '10 #4
thenanox
3 New Member
@Dormilich
good to know, because it was a headache this morning for me:P

Thank you
Jul 23 '10 #5

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

Similar topics

1
2221
by: Tony Hedge | last post by:
Hello, I hope some one can answer this for me. I am using .NET version 1.0 on Windows 2000Pro and I am getting an error when doing a form submit from an HTML control. Please look at the following brief code example: I have two aspx file WebForm1.aspx and WebForm2.aspx. WebForm1 has the following elements:
3
6690
by: David Gonneau | last post by:
I'm getting an incredible behaviour of internet explorer. I have a generated html page with one form and many input of checkbox type. Those checkbox are grouped in 4 lists and each list of checkbox contain checkboxs with the same name so I can easily retrieve on my server side (java) wich checkbox are checked with a request.getParameterValues(). (Each checkbox has a value corresponding to the id of the row) Anyway that's not on the...
4
10700
by: Bradley Kite | last post by:
Hi all. I'm trying to diagnose/solve a problem with internet explorer, whereby sometimes the form submits, and other times IE produces an 'invalid syntax' error. First, I have a form, and within the form is a button bar and a <div> block which contains a table of parameters. The div block is used to create a layer.
8
1979
by: shandain | last post by:
Ok, I have done this a million times, and I can't get this to work... I hope I am just being an idiot and missing something... but I can't see it... so please call me an idiot and tell me what it is... <code> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <HTML> <HEAD> <title>Online Orientation Quiz</title> <meta http-equiv="Content-Type" content="text/html;
0
1647
by: Alvin Bruney | last post by:
When i submit a form from the client side using document.all.RateManForm.submit(); in the code behind, changing text in a text box or trying to prompt the user with a response.write("<script>alert('something croaked.')</script>"); and/or or Label4.Text = "something died"; doesn't show up on the form. If i remove the submit() call, then everything works fine. I know this is a bug. I need a work around so that I can submit a form and...
4
3500
by: John Boy | last post by:
Hi, Can anyone help. This is really doing my nut in. 3 years ASP exp. and now doing .DOT which is a step in the wrong direction. Basically I am left with the code of a guy who has left. When I click a button on a pop-up window the javascript for that button click does a 'button.form.submit'. On the Server side there is a Button click event for this button, but for some reason it no longer fires. It worked fine before and everything...
3
1444
by: Xerxes | last post by:
Hi, I am trying to submit a form when a non-submit button is clicked! I have: <input name="add_dev" type="button" value="Add Device" onClick=" this.form.action='<?php echo $_SERVER?>'; this.form.submit();"> When I run it, it says: this.form.submit is not a function.
1
1784
by: rwelchman | last post by:
Hi, I have a problem with a submit form in that it does not submit(error message), I think because there is another form on the page whose action is to work out various inputted variables and give an answer on the page when entered, which it does. But the next form (form2) is a submit form to a .pl file on my server in the cgi-bin. All the variables on the .pl and server settings are correct but I think it is the other form which is not...
1
10799
by: gbezas | last post by:
Hi All, I have added an event handler to redirect form.submit() to a newSubmit() method that I have defined (which does some additional processing before submitting the form). Additionally I have defined the relavant function method in the code for details) The issue is that when Icall targetForm._submit() method from the newSubmit() function the page I get an 'Object doesn't support this property or method' error I am using IE...
4
2272
by: szimek | last post by:
Hi, I've already posted an email with this problem, but this time I think I got a bit more info. The app I'm currently working on works like this: when user clicks on a clickable element, it handles its onclick event and sets values of input fields in hidden form according to event data etc. The form is submitted, on the server side there's some javascript generated that is injected into a hidden frame (the same where the hidden form...
0
8172
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8620
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8335
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8474
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7158
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4079
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4174
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2605
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1784
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.