I have a form on a website, where I need to submit hundreds of records, manually. The form is in POST method.
I tried with the simple: http://.../form?incomingLead__email=MYNAME
. but this didn't work.
How can I manipulate the Form submission action to include the values?
Trying with a single field as follow: this is the First Name attribute from the HTML:
<input id="incomingLead__firstName" name="incomingLead__firstName"
class="text" style="" type="text" onkeypress="var _this=this;return
onEnterPressed(event, function()
{document.controller.setValue('/ctx/incomingLead/@firstName',
_this.value, 'incomingLead__firstName');return true;});"
onblur="document.controller.setValue('/ctx/incomingLead/@firstName',
this.value, 'incomingLead__firstName')">
The form attribute is:
<form method="post" name="page" class="main-navigation" id="page-form">
Submit button:
<button type="button" id="link-link330" onclick="return linklink330();">Submit</button>
Validate JS function:
function toValidate() {
var temp = document.getElementById('temp')
if (!temp) return document.controller.submit('submit');
document.controller.setValue("/ctx/vars/iCountProducts", temp.options.length);
for (var i = 0; i < temp.options.length; i++)
document.controller.setValue("/ctx/vars/products/product" + i, temp.options[i].value);
return document.controller.submit('submit');
}
I think of having an excel file, and concatenate the links I need, at least I can reduce the time form filling data, into 2 clicks: one in excel to open the webform, and than submit.
Is it possible with the data given?
To post HTML form data to the server in URL-encoded format, you need to make an HTTP POST request to the server and provide the HTML form data in the body of the POST message. You also need to specify the data type using the Content-Type: application/x-www-form-urlencoded request header.
POST: In the post method, after the submission of the form, the form values will not be visible in the address bar of the new browser tab as it was visible in the GET method. It appends form data inside the body of the HTTP request. It has no size limitation. This method does not support bookmark the result.
By typing it in. By giving the input tag a value attribute with whatever text you want pre-populated.
Form populating is only possible if the system you're trying to upload to provides such feature. Even if it does, it is only one step away from truly manual data entry, so I recommend avoiding it. Hundreds of records would take a long time.
If your data source is an excel file, you can automate the entire upload process. Simply read the excel file, process the relevant rows one by one, send a POST request for each one.
Here is an example implementation in PHP:
//open xlsx file
$simple = new SimpleXLSX('power-mosfet.xlsx');
//get rows from the first worksheet
$rows = $simple->rows(1);
//process specific lines (starts from 0)
$fromLine = 2;
$toLine = 8;
for($i = $fromLine; $i<$toLine; $i++){
//select relevant values
$data = [
'name' => $rows[$i][0], //column 1
'vdss' => $rows[$i][1], //column 2
'rdson' => $rows[$i][2], //column 3
];
//send the data in a post request
$ch = curl_init('http://example.com/form');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_exec($ch);
curl_close($ch);
}
If PHP isn't in your wheelhouse, just use a programming language that is. The concept is the same.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With