Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
Improve this question
I have a form with a input field like this:
<input type="hidden" id="name" name="name" value="">
Value of this input is changing trough some javascript function.
Now i would like to displays this value dynamicaly. For example:
<h1>This is the name: *input name value here*</h1>\
I know that you can use the value from different elements on a form when submiting, using the $_POST["name"]. But what about getting the value on same page dynamicaly.
<input type="text" id="name" name="name" value="" onblur="myFunction()">
<h1 id="fname"> </h1>
<script>
function myFunction() {
document.getElementById("fname").innerHTML = document.getElementById("name").value;
}
</script>
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
Developing a school website in WordPress and need to upload Progress Report of students in the server in pdf format. File name of Progress report will be the Admission number of the students (Eg. 123.pdf). When students enter their Admission number in the input box, they should get their progress report file downloaded. As of now using below form box to redirect to file url.
<script>
function process()
{
var url="http://demo.websign.in/" +
document.getElementById("url").value;
location.href=url;
return false;
}
</script>
<form onSubmit="return process();">
ENTER YOUR ADMISSION NUMBER: <input type="text" name="url" id="url">
<input type="submit" value="DOWNLOAD">
</form>
Any help as I am a theme developer and no much knowledge in coding?
You do not need form tag to download file. Also instead of type "submit" use "button". The js you need is something like this:
function myFunction()
{
var downloadUrl = document.getElementById("url").value;
document.getElementById("downlod").href = downloadUrl + '.pdf';
}
<div>
<label>ENTER YOUR ADMISSION NUMBER:</label> <input type="text" name="url" id="url" onkeypress="myFunction()">
<a href="foo" id="downlod" download><span>Download</span></a>
</div>
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
Using this guide to create a "button switch" like this: http://www.w3schools.com/howto/howto_css_switch.asp
What I would like to know, is how can I return a true or false value from this switch in PHP? So for example, I could use this switch like:
if( $button_value == true ) {
// do this
}
You need to give a name to the <input> element. If the button is checked, $_POST['name'] will be set in the PHP script when you submit the form.
So the HTML should be:
<!-- Rectangular switch -->
<label class="switch">
<input type="checkbox" name="switch">
<div class="slider"></div>
</label>
Then the PHP will be:
if (isset($_POST['switch'])) {
// do this
}
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
May I Ask About Angular
I am a beginner and
I need to pass a value from Button to Input text
I have many Buttons like
When I Press abutton the Text Value will change
If you are using angular js then following thing can help you.
var app = angular.module('app', [ ]);
app.controller('MyController', function($scope) {
$scope.setValue = function(number){
$scope.myValue = number;
};
});
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.22/angular.min.js"></script>
<body ng-app="app">
<div ng-controller="MyController">
<button ng-click=setValue('One')>One</button>
<button ng-click=setValue('Two')>Two</button>
<button ng-click=setValue('Three')>Three</button>
<input value="{{myValue}}" />
</div>
</body>
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
There is a href tag:
Send
or a button (needs form tag)
<form action="file.php" method="GET">
<button type="submit">Send</button>
</form>
that will redirect to file.php URL.
I want to send id parameter to another PHP file. How do I do that?
==========================================================================
To send that data where must be provided input params (ex. hidden input) or in-url parameter.
ex.
<form action="file.php" method="GET">
<button type="submit">Send</button>
<input type="hidden" name="id" value="YOUR_ID"
</form>
or
Send
You want to transfer the id only to the next file? Use this in the first:
link_to_2
or
<form...>
<input name="id" type="hidden" value="1">
<button type="submit">btn_to_2</button>
</form>
And in your second file use this for both cases:
<?= $_REQUEST['id'] ?>
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
i have a problem, i will send a POST with PHP but i will
send a GET Parameter with the form value:
<form action="/Eventsuche/" method="post">
<table>
<tr>
<td>
<input id="Headsucheort" name="Headsucheort" type="text" value="" />
</td>
<td>
<button type="submit" name="Submit" id="Headsuchestart" value="Headsuchestart">»</button>
</td>
</tr>
So, on submit he bring me to /Eventsuche/ but i would like to
go here: /Eventsuche/Value of Headsucheort
Thanks! :)
<button onclick="window.location.href='/Eventsuche/' + document.getElementById('Headsucheort').value">»</button>
Didn't test but
If you really must do it in PHP, add this to Eventsuch:
if ( isset($_POST['Headsucheort']) ) {
header('location:http://www.your-url.com/Eventsuche/'.$_POST['Headsucheort']);
exit;
}
I see two ways to the that.
first:
you can add your variable to the end of your action value such as: action="Eventsuche?var=somevalue"
and second one would be:
as a hidden input and even tho it is hidden, php will capture it on submit as in:
<input type="hidden" name="myvar_name" value="my_var_value" />
i think this should do it.