How to select an element by name in FBML/FBJS? - fbml

i have this form below:
<form fbcontext="65d93ec1624a" id="app23744633048_frmFBNewsletter" action="http://register.stage.creative.com/Api/Facebook/SubscribeNewsletter" method="post"><input type="hidden" value="117533374986109" name="fb_sig_profile"><input type="hidden" value="1" name="fb_sig_is_admin"><input type="hidden" value="PAGE" name="fb_sig_type"><input type="hidden" value="0" name="fb_sig_is_fan"><input type="hidden" value="en_US" name="fb_sig_locale"><input type="hidden" value="1" name="fb_sig_in_new_facebook"><input type="hidden" value="1295493683.2974" name="fb_sig_time"><input type="hidden" value="0" name="fb_sig_added"><input type="hidden" value="sg" name="fb_sig_country"><input type="hidden" value="117533374986109" name="fb_sig_page_id"><input type="hidden" value="1" name="fb_sig_page_added"><input type="hidden" value="d2182fe10890bbfe8002bbdb6b6954ab" name="fb_sig_api_key"><input type="hidden" value="23744633048" name="fb_sig_app_id"><input type="hidden" value="7eaa52ce1dab5341d230cbd6b6bd42a8" name="fb_sig">
</form>
and i need to retrieve the fb_sig_country.
i try the javascript getelementsbyname but that doesn't seems to be supported in FBJS.
i've also try the getchildnodes method but still can't get the value.
<script>
<!--
var countrycode = document.getElementById('frmFBNewsletter').getChildNodes()[8].getName();
function changeCountry(frmID){
var msgdialog = new Dialog();
msgdialog.showMessage('Error', countrycode);
}
-->
</script>
any help would be more appreciated :)

in case anybody was wondering how i resolved this issue, what i found out was that all of these values are actually posted over to the server side when the form submits.
i can see those values via firebug, thus there was no need for me to manually retrieve those values on the client side :)

Related

Get all content of POST HTML form in Gin

I've an HTML form:
<body>
<div>
<form method="POST" action="/add"name="submitForm">
<label>Message</label><input type="text" name="message" value="" />
<input type="checkbox" name="complete" value=""> Complete<br>
<input type="submit" value="submit" />
</form>
</div>
</body>
Now I want to access both values (message and complete) at the same time when a POST occurs.
How can I do this in Go (gin gonic)?
I can do it in two times by using c.PostForm but is there a way to collect them both?:
func AddTodoHandler(c *gin.Context) {
fmt.Println(c.PostForm("message"))
fmt.Println(c.PostForm("complete"))
I tried fmt.Println(c.PostForm("submitForm")) but that did not work.
I don't know if you've already solved this, but the way I managed to capture the 2 values simultaneously was by removing the value from the checkbox and using the Request.PostForm instead of the PostForm.
I tried using the form's name or id, but it seems that it's still not possible to get the data from them.
<body>
<div>
<form method="POST" action="/add" name="submitForm"> << not work
<label>Message</label><input type="text" name="message" value="" />
<input type="checkbox" name="complete"> Complete<br> << remove value attribute
<input type="submit" value="submit" />
</form>
</div>
</body>
func AddTodoHandler(c *gin.Context) {
fmt.Println(c.Request.PostForm)
Note: as my reputation is less than 50pts, I cannot comment on the post.

zoho remote api normal form server side code

I am using zoho remote api for normal form, but i get error whenever i try to save my document Please help me to correct my code that is given below
i need help to save my document. every time i save the document get the error "unable post the content"
<form accept-charset="UTF-8" target="_blank" action="https://sheet.zoho.com/remotedoc.im" method="POST">
<input type="hidden" value="http://example.com/demo1/test.csv" name="url">
<input type="hidden" value="**********" name="apikey">
<input type="hidden" value="editor" name="output">
<input type="hidden" value="normaledit" name="mode">
<input type="hidden" value="test.csv" name="filename">
<input type="hidden" value="en" name="lang">
<input type="hidden" value="12345678" name="id">
<input type="hidden" value="csv" name="format">
<input type="hidden" value="save.php" name="saveurl">
<input c type="submit" value="Details" name="submit">
</form>
<?php
$filepath = '/home/spatials/public_html/demo1/'.$_FILES['content']['name'];
$tmp_filename = $_FILES['content']['tmp_name'];
$upload_status = move_uploaded_file($tmp_filename, $filepath);
?>
Pleas correct my code
Wrong Save URL:
<input type="hidden" value="php/save.php" name="saveurl" />
Correct Save URL:
<input type="hidden" name="saveurl" value="http://example.com/demo1/save.php" />
WIKI page link for reference: https://apihelp.wiki.zoho.com/Save-Document.html

Why is PayPal ignoring discount_amount_cart?

I have been using PayPal Payments Standard. Everything has been working great. Now I want to add support for coupon discounts.
According to the documentation, the discount_amount_cart variable appears to be what I want:
Single discount amount charged cart-wide.
It must be less than the selling price of all items combined in the cart. This variable overrides any individual item discount_amount_x values, if present.
Applies only to the Cart Upload command.
So, I add the variable to my form:
<form id="Paypal" name="Paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input id="cmd" name="cmd" type="hidden" value="_cart">
<input id="upload" name="upload" type="hidden" value="1">
<input id="business" name="business" type="hidden" value="kelly#hopskipdesign.com">
<input id="custom" name="custom" type="hidden" value="Client">
<input id="discount_amount_cart" name="discount_amount_cart"
type="hidden" value="$4.00">
<input id="tax_cart" name="tax_cart" type="hidden" value="$1.65">
<input id="currency_code" name="currency_code" type="hidden" value="USD">
<input id="return" name="return" type="hidden" value="http://www.hopskipphotography.com/Order/Confirm/Client">
<input id="cancel_return" name="cancel_return" type="hidden" value="http://www.hopskipphotography.com/Order/Cart/Client">
<input id="cbt" name="cbt" type="hidden" value="Place Order">
<input id="item_name_1" name="item_name_1" type="hidden" value="Photo #6">
<input id="amount_1" name="amount_1" type="hidden" value="$20.00">
<input id="item_number_1" name="item_number_1" type="hidden" value="B49A8382">
<input id="quantity_1" name="quantity_1" type="hidden" value="1">
<input id="item_name_2" name="item_name_2" type="hidden" value="Photo #10">
<input id="amount_2" name="amount_2" type="hidden" value="$20.00">
<input id="item_number_2" name="item_number_2" type="hidden" value="B49A8428">
<input id="quantity_2" name="quantity_2" type="hidden" value="1">
<div class="checkout-button">
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_xpressCheckout.gif" alt="Check out with PayPal">
</div>
</form>
But when I click the button, everything appears except the discount:
I found a similar question where the answer was to use the tax_cart variable instead of tax_x. But I was already using tax_cart.
Any other ideas as to why discount_amount_cart is not working?
Unlike other amount variables, discount_amount_cart does not like dollar signs.
When I changed the field to:
<input id="discount_amount_cart" name="discount_amount_cart"
type="hidden" value="4.00">
PayPal displayed the discount:

Magento - How can I pass UserId instead of OrderId to ADYEN SKIN

I'm using adyen to pay by credit cards and I notice that when the user pays, the module on Magento passes the order id as MerchantReference to Adyen.
In order to activate the "remember my data" during the payment using adyen SKIN, I need to pass the UserId and not the orderId.
Any suggestion how to solve it?
--- More info ---
This is the specific module: http://www.magentocommerce.com/magento-connect/adyen-payment.html
And, this is the form example that we generate for the payments on Adyen, in another environment. As you can see, the merchantReference is an unique value, which identify the first user payment. This values is calculated using UserId, so we could identify the user for his next payments.
I should need to know where the plugin Adyen (for Magento) generate this form, so I could change the merchantReference parameter using UserId and not OrderId
<form action="https://test.adyen.com/hpp/pay.shtml"
method="post" id="gatewayPaymentForm">
<input type="hidden" name="merchantReference" value="Ajx">
<input type="hidden" name="paymentAmount" value="2900">
<input type="hidden" name="currencyCode" value="EUR">
<input type="hidden" name="shipBeforeDate" value="2013-02-03">
<input type="hidden" name="skinCode" value="XDFGG">
<input type="hidden" name="merchantAccount" value="NameAccount">
<input type="hidden" name="shopperLocale" value="es">
<input type="hidden" name="sessionValidity" value="2013-01-31T16:35:31+01:00">
<input type="hidden" name="merchantSig" value="bcbXNhsd">
<input type="hidden" name="shopperEmail" value="asd#gmail.com">
<input type="hidden" name="shopperReference" value="5">
<input type="hidden" name="recurringContract" value="ONECLICK">
</form>
Thank you
Already solved, we modified the file: /Madia/Adyen/Model/Adyen/Hpp.php
//To identify and remind user data with mail.
$adyFields['shopperReference'] = $customerEmail;
It works for us.

Editing Magento Checkout Form

On clicking "place order" in Magento, I want to capture some of its values and feed them to the following form:
<form method="post" action="https://www.jambopay.com/JPExpress.aspx" target="_blank">
<input type="hidden" name="jp_item_type" value="cart"/>
<input type="hidden" name="jp_item_name" value="test shop"/>
<input type="hidden" name="order_id" value="455879"/>
<input type="hidden" name="jp_business" value="business#yourdomain.com"/>
<input type="hidden" name="jp_amount_1" value="51"/>
<input type="hidden" name="jp_amount_2" value="0"/>
<input type="hidden" name="jp_amount_5" value="0"/>
<input type="hidden" name="jp_payee" value="email#yourcustomer.com"/>
<input type="hidden" name="jp_shipping" value="company name"/>
<input type="hidden" name="jp_rurl" value="http://www.yourwebsite.com/testpost/Result.aspx?ii=0"/>
<input type="hidden" name="jp_furl" value="http://www.yourwebsite.com/testpost/Result.aspx?ii=1"/>
<input type="hidden" name="jp_curl" value="http://www.yourwebsite.com/testpost/Result.aspx?ii=2"/>
<input type="image" src="https://www.jambopay.com/jambohelp/jambo/rsc/paymentsbyJamboPay.jpg"/>
</form>
The values include:
Order Number,
Total Amount,
Customers Email Address,
How do i do this?
You can get value of order after save order is called you can get last order id from this methods
$orderId = Mage::getSingleton('checkout/session')->getLastOrderId();
once you have order id then load order like this
$order = Mage::getModel('sales/order')->load($orderId);
and you can get all details of order

Resources