Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function encode_form(id){
- var form = document.getElementById(id);
- if(form === null) return null;
- var inputs = form.children;
- var out_encoded_data = "";
- for(var i=0; i < inputs.length; i++){
- if(inputs[i].tagName == "INPUT" || inputs[i].tagName == "TEXTAREA" || inputs[i].tagName == "SELECT"){
- if(out_encoded_data == ""){
- out_encoded_data += inputs[i].name + "=" + encodeURIComponent(inputs[i].value);
- }else{
- out_encoded_data += "&" + inputs[i].name + "=" + encodeURIComponent(inputs[i].value);
- }
- }
- }
- return out_encoded_data;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement