Encontre un efecto para mostrar un cartel con mensaje este es link
http://s3.envato.com/files/348021/index.html
Lo estoy usando para un buscador me gustaria si el texto input esta vacio muestre el mensaje
"Ingrese una palabra para buscar" y sino ejecuta la accion de buscar action="buscar.php".
Pero lo que quiero es que muestre el cartel sino hace la accion buscar.
Este es el codigo:
Código PHP:
<script>
jQuery(document).ready(function()
{
jQuery("#message1").click(function()
{
AttentionBox.showMessage("Ingrese una palabra para buscar.");
});
jQuery("#message2").click(function()
{
AttentionBox.showMessage('This example has a <strong style="color:red">formatted</strong> message.');
});
jQuery("#message3").click(function()
{
AttentionBox.showMessage('This message is modal by diming the background.',
{
modal: true
});
});
jQuery("#message4").click(function()
{
AttentionBox.showMessage('This modal message has blue background.',
{
modal: true,
modalcolor: "#00AAFF"
});
});
jQuery("#message5").click(function()
{
AttentionBox.showMessage('This message can have multiple buttons.',
{
buttons :
[
{caption : "Yes" },
{caption : "No" }
]
});
});
jQuery("#message6").click(function()
{
AttentionBox.showMessage('A message can have buttons marked as important.',
{
buttons :
[
{ caption : "Blue" },
{ caption : "Red", important : true }
]
});
});
jQuery("#message7").click(function()
{
AttentionBox.showMessage('A message can has a cancel button.',
{
buttons :
[
{ caption : "Cancel", cancel: true },
{ caption : "Save" }
],
callback: function(action)
{
if (action == "CANCELLED")
{
AttentionBox.showMessage('User cancelled');
}
}
});
});
jQuery("#message8").click(function()
{
AttentionBox.showMessage('This message can take user input.',
{
inputs :
[
{caption: "Fullname"},
{caption: "Age"}
]
});
});
jQuery("#message9").click(function()
{
AttentionBox.showMessage('This message has pre-populated input boxes.',
{
inputs :
[
{caption: "Fullname", value: "Denon Studio" },
{caption: "Age", value: "12" }
]
});
});
jQuery("#message10").click(function()
{
AttentionBox.showMessage('This message has required input boxes.',
{
inputs :
[
{caption: "Fullname", value: "Denon Studio", required: true },
{caption: "Age", required: true }
]
});
});
jQuery("#message11").click(function()
{
AttentionBox.showMessage('This message has error messages for input boxes.',
{
inputs :
[
{caption: "Fullname", error: "Invalid fullname" },
{caption: "Email" },
{caption: "Age", error: "Invalid age" }
]
});
});
jQuery("#message12").click(function()
{
AttentionBox.showMessage("This message is handled using a callback.",
{
modal : true,
inputs :
[
{caption: "Fullname", value: "Denon Studio", required: true},
{caption: "Age", value: "34", required: true},
{caption: "How did you hear about us?", value: "Newspaper", required: true}
],
callback: function(action, inputs)
{
var message = "";
if (action != "CANCELLED")
{
message = "User inputs were:<br/><br/>";
for (var i = 0; i < inputs.length; i++)
message += inputs[i].caption + " <strong>" + inputs[i].value + "</strong><br/>";
}
else
{
message = "User canceled";
}
AttentionBox.showMessage(message);
}
})
});
});
</script>
<form method="get" class="searchform" action="index.php" >
<input type="text" name="q" />
<input type="submit" class="searchsubmit" value="Buscar" id="message1"/>
</form>
Saludos !