create two form submissions from one button - html

I have a simple form that submits some data to an SMS server to send an SMS. I need to create two seperate messages from one button. message1 needs to go immediately and message2 needs a delay, which the gateway supports.
I Need two different "message" fields, one with the delay and one without. I dont think the server allows two commands from one submission. Is there a way of getting the forms to submit sequentially from one button ?
The fields that are common to both messages are :
<form action="https://api-mapper.clicksend.com/http/v2/send.php" method="post">
<input name="key" type="hidden" value="xxxxxxxxx" />
To: <input name="to" type="text" />
<input name="username" type="hidden" value="xxxxxx" />
<button type="submit" >SUBMIT</button>
the fields that cause me issues are:
<input name="message" value="message1" />
<input name="message" value="message2" name="schedule" value="time" />

try this.
<form id="form1" action="action.php", method="post">
<input name="key" type="hidden" value="xxxxxx"/>
<span>To:</span> <input name="to" type="text" />
<input name="username" type="hidden" value="xxxxxx" />
</form>
<form id="form2" action="action2.php", method="post">
<input name="message1" value="message1" />
<input name="message2" value="message2" name="schedule" value="time" />
</form>
<button type="submit" onclick="submitForms">SUBMIT</button>
<!-- add this tag after your body tag -->
<script>
var submitForms = function() {
document.getElementById("form1").submit();
document.getElementById("form2").submit();
}
</script>

Related

pre-fill forms without id's

So, I was wondering if it was possible to pre-fill a form that doesn't include IDs. If I had a form like this:
<form action="" method="POST" >
<input type="text" name="title" />
<input type="submit" value="Submit" />
</form>
Would it be possible to pre-fill this form on an already built website, without editing the HTML code?
For reference, the link I would like to do this on is:
https://crystalmathlabs.com/tracker/compcreate.php
Since you asked for a jquery solution you can do this
var i=0;
$('form > input').each(function(){
$(this).attr('id','id'+i);
i++;
})
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<form action="" method="POST" >
<input type="text" name="title" />
<input type="submit" value="Submit" />
</form>

Wufoo: Your submission is missing the secure POST key

There was a problem with your submission.
Your submission is missing the secure POST key.
when I am redirected on Wufoo then got the warning or error
I have attached screenshot related error
HTML
<form name="Wufoo Button" accept-charset="UTF-8"
enctype="multipart/form-data" method="post"
action="https://subdomainname.wufoo.com/forms/sponsorchild/">
<!-- Dollars -->
<input id="Field127" name="Field127" type="hidden" t-att-value="Field127" />
<!-- Cents -->
<input id="Field127-1" name="Field127-1" type="hidden" t-att-value="Field1271" />
<!-- Child name and file number -->
<input id="Field125" name="Field125" type="hidden" t-att-value="Field125" />
<input id="saveForm" name="saveForm" class="submit" type="submit" value="Submit" />
</form>
Not sure if you're still stuck on this but I found the answer.
You need to keep this bit of HTML at the end of the form (you can just hide it with css). The value acts as the key:
<li class="hide">
<label for="comment">Do Not Fill This Out</label>
<textarea name="comment" id="comment" rows="1" cols="1"></textarea>
<input type="hidden" id="idstamp" name="idstamp" value="[WUFOO VALUE IS HERE]" />
</li>

unable to submit form by clicking input submit button on IE11

I have following form and unable to submit by clicking submit button.
<form name="fEdit" class="inputform" id="my_form" method="post" action="test" enctype="multipart/form-data">
<input type="hidden" name="mode" value="update" />
<input type="hidden" name="tab" value="<?=$tab?>" />
<input type="hidden" name="id" value="" />
<input type="submit" value="確定" onclick="return confirm('Do you want to save?');" />
</form>
I think the problem is action="test"
The action=" " attribute specifies where to send the form-data when a form is submitted
example ..
<form action="test.html/test.php" method="post/get">
The reason why I can not post was that HTML maxlength attributes.

add parameters to form url before submit

I need to add a path to a file to the form url before submitting. I created therefore a text field and want to add the text to the url without php.
can somebody help?
the existing code:
<form action="http://127.0.0.1:8080/WebService1/HTTPMethod_1?new_value=value" method="post">
<input type="text" value="" size="30" name="filename">
<input type="submit" name="submit" value="Submit" class="continue-button">
</form>
look into using hidden input fields. these allow you to send form data, but not necessarily show a form field.
for instance:
<script type="text/javascript">
function setFormAction() {
document.myForm.action = document.getElementById("url").value;
}
</script>
<form name="myForm" method="POST" action="default.php">
<input type="value" name="url" id="url" />
<input type="submit" name="submit" onclick="setFormAction();" />
</form>

HTML form name replaced with wrong symbols

I have the following form
<form name="input" action="http://testdomain.com/search/?" method="get" autocomplete="off">
<input type="text" name="?wpv_paged_preload_reach=1&wpv_view_count=1&wpv_post_id=205499&wpv_post_search=">
<input type="submit" id="searchsubmit" value="">
</form>
However the actual URL displays the following search query:
/search/?%3Fwpv_paged_preload_reach%3D1%26wpv_view_count%3D1%26wpv_post_id%3D205499%26wpv_post_search%3D=test
It seems that special symbols such as ? and = are getting replaced with special Encoding characters.
My question is, how do I get the form to not switch my special symbols with the encoding characters?
Thanks
The name of an input element controls the name of one field. The browser doesn’t blindly mash it and its value together and send that to the server. For a GET request, you can include each one as a hidden field:
<form name="input" action="http://testdomain.com/search/" method="get" autocomplete="off">
<input type="hidden" name="wpv_paged_preload_reach" value="1" />
<input type="hidden" name="wpv_view_count" value="1" />
<input type="hidden" name="wpv_post_id" value="205499" />
<input type="text" name="wpv_post_search" />
<input type="submit" id="searchsubmit" />
</form>