It's been a while since I tried this, and last I tried it had worked but now I'm running into a bit of a problem.
Simply, I have a service that's requesting I add Form code to the site, in the past I'd used the method outlined by John Mitchell (http://blogs.snapsis.com/PermaLink,guid,94277650-bd4c-445f-badf-b84646ecc8eb.aspx) . However, in trying that lately on a 5.1.1 site, it's been causing page errors and hangups. When I look into the rendered source, it seems to be having issues with the following script that's loaded on each page:
var
theForm = document.forms[
'Form'
];
if
(!theForm) {
theForm = document.Form;
}
function
__doPostBack(eventTarget, eventArgument) {
if
(!theForm.onsubmit || (theForm.onsubmit() !=
false
)) {
theForm.__EVENTTARGET.value = eventTarget;
theForm.__EVENTARGUMENT.value = eventArgument;
theForm.submit();
}
}
I only get errors on the page where I've entered the form code, and it's usually when I'm trying to Edit Content or do anything with the module containing my form code. For reference, this is what I'm dealing with:
Original Form code provided by 3rd Party Payment Processing system (not PayPal):
(domains redacted for security/privacy)
<
input
type
=
"text"
size
=
"6"
name
=
"amount"
/>
<
input
type
=
"hidden"
name
=
"key_id"
value
=
"1234567"
/>
<
input
type
=
"hidden"
name
=
"action"
value
=
"process_variable"
/>
<
input
type
=
"hidden"
name
=
"order_description"
value
=
"Online Payment"
/>
<
input
type
=
"hidden"
name
=
"language"
value
=
"en"
/>
<
input
type
=
"hidden"
name
=
"customer_receipt"
value
=
"true"
/>
<
input
type
=
"hidden"
name
=
"hash"
value
=
"action|order_description|REDACTEDHASH"
/>
<
input
type
=
"submit"
name
=
"submit"
value
=
"Pay Online Now!"
/>
form
>
After I modified per John's instructions:
<
input
type
=
"text"
size
=
"6"
name
=
"amount"
/>
<
input
type
=
"hidden"
name
=
"key_id"
value
=
"1234567"
/>
<
input
type
=
"hidden"
name
=
"action"
value
=
"process_variable"
/>
<
input
type
=
"hidden"
name
=
"order_description"
value
=
"Online Payment"
/>
<
input
type
=
"hidden"
name
=
"language"
value
=
"en"
/>
<
input
type
=
"hidden"
name
=
"customer_receipt"
value
=
"true"
/>
<
input
type
=
"hidden"
name
=
"hash"
value
=
"action|order_description|REDACTEDHASH"
/>
Help? Has something changed between 4.x and 5.x that would interfere with this method of handling HTML Post code inside DNN? I'd prefer NOT to do this in an iFrame if at all possible.