Jump to content

[HTML Form] Want some help from the "experts"


Kogkalidis

Recommended Posts

I want to develop a custom module for booking rooms, tables and whatever it is.. And want to do the following.. Make a <select> ... </select> with options: 1. --Choose--, 2. 1, 3. 2 etc.. How can I check if clicking on submit button and the first option is selected to show some kind of message "you chose nothing for {select 1}, if you continue the field will be considered as null" ?

 

Thanx in advance

Link to comment
Share on other sites

You could do the trick with some of script jquery before send... just like....

 

 

var $isSeleccted = $("#optionsAvailable").val();

 

if($isSelected == null || $isSelected == '' ){

// on this case you could show some div with the Error

alert("you chose nothing for option ");

}

});

 

on your .tpl

 

this shoul do the trick! :)

 

PD: Of course that you should modify this javascript jquery script for adapt it at your convenience .....

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...