unable to submit form by clicking input submit button on IE11 - html

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.

Related

create two form submissions from one button

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>

form post action going to wrong URL

I have another personal website I want to post my form to, see code
<form name="requestPrint" action="www.mysite1.com/set_var.cgi"
method="POST">
<input name="value" type="hidden" size="8" value="1">
<input type="hidden" name="page" value="mypage.html"/>
<input type="hidden" name="index" value="94"/>
<input type="submit" value ="Print">
</form>
However when the form posts it goes to www.mysite2.com/www.mysite1.com/set_var.cgi
Is there a way to point it to just www.mysite1.com/set_var.cgi?
You should try the following:
action="http://www.mysite1.com/set_var.cgi"

How to select with submit button is chosen with this.form.submit()?

I have one form with two submit buttons (like in the question Two submit buttons in one form):
<form action="/doit" method="post">
<input name="commonfield1" />
<input name="commonfield2" />
<input type="submit" name="action1" value="Do something" />
<input type="file" name="file" onchange="this.form.submit()" />
<input type="submit" name="action2" value="Do something else" />
</form>
When doing onchange="this.form.submit()", which submit is used? How to select if we submit using action1 or action2?
Note: why not having two separate forms? Because the commonfield1 and commonfield2 inputs should be common to both.

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>

send get parameters using action attribute of form and even send the form elements

I want to sent parameters using action and even the value of input name=edit parameters but only
ajaxify/modify.php?edit=something
is sent instead of
ajaxify/modify.php?f=update&id=5&edit=something
Is there any solution for this or I am doing some blunder. Please help me.
<form id="update" action="ajaxify/modify.php?f=update&id=5">
<input type="text" name="edit" value="something"/>
<input type="submit" value="update"/>
</form>
Use hidden input. This will work for get/post methods. Example:
<form id="update" action="ajaxify/modify.php">
<input type="hidden" name="id" value="5"/>
<input type="hidden" name="f" value="update"/>
<input type="text" name="edit" value="something"/>
<input type="submit" value="update"/>
</form>
Set the method attribute of the form element to get to make it do a get instead of a post.
<form id="update" action="ajaxify/modify.php?f=update&id=5" method="get">