Jump to content

Barra de Edit com Button e Links


Npc Bugadi

Recommended Posts

Desculpe se postei errado, primeiro dia no forum;
 

Eu comecei a estudar php ontem, queria saber se tem alguma maneira de colocar uma barra de edit como essa:
 

        <td width="25%">Quantidade de Moedas</td>
        <td>
        <input  type="text" value="1" size="5" maxlength="5" $Test >
        </td>


E dependendo dq a pessoa colocar dentro.. ela seguir uma determinada url, por exemplo se ela deixar o numero 1, e apertar algum button associado a essa barra de edit( não sei se chamam assim em php) ele seguir a url responsável pelo numero, se colocar o numero 2 seguir outra url, etc

Link to comment
Share on other sites

O encaminhamento da página a seguir, podes fazer via JS ou PHP validando o valor do input.

 

Em PHP nas variáveis $_POST, em JS "document.getElementById("myText").value".

 

JS

var x = document.getElementById("myText").value;

if(x==....){

	window.location="https://stackoverflow.com";
 
}

PHP

$varx = $_POST['input1];

if($varx==....){

	header('Location: https://stackoverflow.com');
}
  • Vote 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.