Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.
Forum rules: Please search to see if a question has already asked before creating a new topic. Please don't post the same question in multiple forums.
#787826
good morning friends
i have dropdown menu in my dynaform that id filled by an array... i put the first value in the menu (.... Please Select ....)
now i want to validate the form when the user press (submit) to prohibit selecting the (.... Please Select ....) value
i wrote this jave code
Code: Select all
function validate(){
        if($('#brc_advisors').getValue() == ".... Please Select ....") {
            alert('please select valid project manager')
            return false;
        }
}
$('#submit0000000001').click(validate);
but nothing happen when i press (submit) it redirects to the next step
please help me
#787837
You need to use form.setOnSubmit() to do this reliably instead of onclick. Also you need to use getText() instead of getValue() for your dropdown box.

However you don't need to use JavaScript. Simply mark the "required" option in the properties for the dropdown box. For your options in the dropdown, set the first key/value to be blank:
Code: Select all
Key   |  Label
--------------------------------
      | ...Please Select ...
opt1  |  Option 1
opt2  |  Option 2           

AI bot development involves creating intelligent b[…]

AI bot development encompasses creating intelligen[…]

A stake clone script is a pre-coded solution desig[…]

The bet365 clone script offers a ready-made soluti[…]