Options for Drop Down Boxes

rss

Posted by Katerina - Oct 29 ’14 at 01:01

Hi,

We have a client who is not happy that a form we have developed for them does not show the drop down fields as blank when when the form is first opened and instead shows the first item in the option list. The client would like the fields to be blank. We had the idea to place an item in the controlling list ***Please Select*** which the client would be happy with but only if we can prevent a user from submitting the form with ***Please Select***. We do not seem able to place validation that woudl revernt this from happening...

The field that is in use is a Lookup Field and probably needs to be so that teh end user can control the options in the form easily.

 

Thanks

  • Dmitry Kozlov
    Dmitry Kozlov
    Admin
    Member for: 9 years 8 months 7 days
    #1 by Dmitry Kozlov Oct 30 ’14 at 02:37

    Hi,

    You can validate the selected value in fd.onsubmit handler via JavaScript:

    fd.onsubmit(function() {
    	if (fd.field('LookupField').value() == 1) {
    		alert('Please, fill-in the Lookup Field');
    		return false;
    	}
    	return true;
    });
    
  • Katerina
    Member
    Member for: 9 years 29 days
    #2 by Katerina Nov 10 ’14 at 11:23

    Hi Dmitry,

     

    I applied the function, put the name of the field in the fd.field and after == I added the ID of the Item that holds the **** - Please Select - **** but the function is not working. Have I done anything wrong?

    Thanks

  • Dmitry Kozlov
    Dmitry Kozlov
    Admin
    Member for: 9 years 8 months 7 days
    #3 by Dmitry Kozlov Nov 11 ’14 at 06:21

    [#2]: Hi Katerina,

    Please, make sure that there're no JS-errors in the browser console and that the handler is executed correctly. You can modify the code above to trace the lookup field value:

    fd.onsubmit(function() {
    	alert('OnSubmit handler is running');
    	alert('Selected ID: ' + fd.field('LookupField').value());
    	if (fd.field('LookupField').value() == 1) {
    		alert('Please, fill-in the Lookup Field');
    		return false;
    	}
    	return true;
    });
    
  • Udaipurescort7
    Member
    Member for: 2 months 17 days
    #4 by Udaipurescort7 Apr 21 ’23 at 10:22

    Welcome To Sexy Call Girls Service in Udaipur

    Welcome to Udaipur . In this escort directory section, you find Udaipur escorts. Euro Girls Escort is the most trusted escort directory and one of the biggest Indian escort directories. All content and photos are regularly checked and updated with real photos. This makes sure, that all escort Ads are always up to date and will bring you the best experience.

     

    https://www.rashmika.co.in https://www.russianmodels.in/about-me https://rashmika.co.in/ajmer-escorts https://rashmika.co.in/jodhpur-escorts https://rashmika.co.in/jaipur-escorts https://rashmika.co.in/kota-escorts https://rashmika.co.in/abu-road-escorts https://rashmika.co.in/mount-abu-escorts https://rashmika.co.in/sikar-escorts https://rashmika.co.in/alwar-escorts https://rashmika.co.in/jaisalmer-escorts https://rashmika.co.in/bikaner-escorts https://rashmika.co.in/pushkar-escorts https://rashmika.co.in/chittorgarh-escorts
Displaying 1 to 4 of 4 messages