1

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>
Manwal
  • 23,450
  • 12
  • 63
  • 93

1 Answers1

1

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>
user3647894
  • 559
  • 1
  • 4
  • 28
  • That´s not hat I want. On the webpage should be an input field, where the user can enter a path to a binary. When clicking the submit button, the entered path should be added to the url in the form tag, because this url is calling a labview vi, which needs the path. I hope this explains what I want to do – Julia Scheidinger Feb 24 '15 at 06:22
  • understood. have you tried using javascript for this? i have updated my answer with some code that may help... – user3647894 Feb 24 '15 at 19:02