开发者

How convert html form to javascript

I have html form

<form action="https://perfectmoney.com/api/step1.asp" method="POST">
<input type="hidd开发者_JAVA技巧en" name="PAYEE_ACCOUNT" value="U1224348">
<input type="hidden" name="PAYEE_NAME" value="Perfect Lottery">
<input type="text" name="PAYMENT_ID" value=""><BR>
<input type="text" name="PAYMENT_AMOUNT" value=""><BR>
<input type="hidden" name="PAYMENT_UNITS" value="USD">
<input type="hidden" name="STATUS_URL" value="">
<input type="hidden" name="PAYMENT_URL" value="http://simplecod.wordpress.com/transfers_completed_successfully">
<input type="hidden" name="PAYMENT_URL_METHOD" value="LINK">
<input type="hidden" name="NOPAYMENT_URL" value="http://simplecod.wordpress.com/transfers_will_fail/">
<input type="hidden" name="NOPAYMENT_URL_METHOD" value="LINK">
<input type="hidden" name="SUGGESTED_MEMO" value="">
<input type="hidden" name="time" value="Your bet on 05/23/2011;">
<input type="hidden" name="BAGGAGE_FIELDS" value="time">>
</form>

I need to do the same thing in javascript and send the link.

How do this?


if you use jquery, you can use the serialize() function which will do exactly what you want. It combines all names and values and generates a string from it.

You can find the function here: http://api.jquery.com/serialize/


not sure about javascript? but you can do this dynamically with a server side script such as Perl or PHP.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜