Visible of div tag when the submit button is clicked
Last Post 11-05-2008 06:10 PM by Sherlock Holmes. 8 Replies.
AddThis - Bookmarking and Sharing Button
Author Messages
Sherlock HolmesUser is Offline
river guide
river guide
Posts:81
Avatar

--
10-20-2008 11:49 PM

    Hi,

     

    I want to make a div tag which contains the errors to be displayed when the submit button is clicked.

    If the user doesn't enters any value in the textbox i want to show the error message. I have placed the error message in a div tag and made it to be visible=false. After clicking the submit button i want an javascript event to be called to check whether the user has entered the value or not if it is not then make the div tag with the error message to be visible,

    I thought of using this with the required field error and text but it doesn't work properly. I want to display the error message in the top when i enter these required field error and text it displays above the form.

    I called the javascript function in the are of  submit/save javascript. In that for testing purpose i gave the script as

    alert($(First_name));   but it shows invalid name First_name. the First_name is the shortname i have used for the textbox then how come it shows an error.

    How the javascript function be called when the submit button is clicked.

     

    So plz do help me soon

     

    Thanks in advance

     

    Chad NashUser is Offline
    Posts:5260
    Avatar

    --
    10-21-2008 11:48 AM
    Sherlock,

    Hi. Well Client Side Events can sometimes be tricky... In this particular instance I think you have the right idea for first checking the alert and then changing the DIV etc... I would make sure to check out and maybe download the IPORTABLE files for demonstration 13 and 14 under the Dynamic Forms Demonstrations area. I would also make sure to use this javascript under the area for 'Initial Javascript' and 'Save Javascript').

    Specifically for your code and error though, my guess is that you need to have 'before and after token. Such as alert('First_name)'); notice the ' before and after the token. I would even first get it to pop up an alert of static text instead of the value so that way you can narrow down the actual javascript VS the field value etc...

    -Chad
    Sherlock HolmesUser is Offline
    river guide
    river guide
    Posts:81
    Avatar

    --
    10-22-2008 09:58 PM
    I was able to Hide the div tag when i lose focus from a textbox but not able to do it when a submit button is clicked. Plz help me out.
    I have one more clarification how to do activate a javascript only during page load .

    Plz do help me out
    Chad NashUser is Offline
    Posts:5260
    Avatar

    --
    10-26-2008 05:01 PM
    Hi, what version are you running under? For version 2.7 you should see options under the Javascript Configuration to fire different Javascript for Page Load and different
    Javascript for save/submission. These should be settings right above the custom javascript file, do you see these?

    -Chad
    Sherlock HolmesUser is Offline
    river guide
    river guide
    Posts:81
    Avatar

    --
    10-29-2008 01:45 AM

    I am using datasprings of version 4.5 and DNN of version 4.x

    Chad NashUser is Offline
    Posts:5260
    Avatar

    --
    10-29-2008 07:58 AM
    Hi. Do you mean 2.5? There is no version 4.5 of Dynamic Forms.
    Sherlock HolmesUser is Offline
    river guide
    river guide
    Posts:81
    Avatar

    --
    10-30-2008 12:00 AM
    i use the version of 2.7
    Chad NashUser is Offline
    Posts:5260
    Avatar

    --
    10-30-2008 03:04 PM
    Hi. Well if you can get javascript to function properly on page load, then the exact same javascript should function under each textbox client side event. By default all textbox client side events are fired 'OnBlur', if you want them to fire in a different way you can set the short field name to include text such as 'onkeyup' or 'onkeypress' etc... This will fire the same javascript when a key is pressed in a textbox etc... Again, this is assuming you are hiding the DIV accordingly within the javascript though.

    -Chad
    Sherlock HolmesUser is Offline
    river guide
    river guide
    Posts:81
    Avatar

    --
    11-05-2008 06:10 PM

    should i have to give the name like submit_Onclick in the javascript and check for the validation



    ---
  • film izle
  • 720 izle
  • film
  • sinema izle
  • film makinesi
  • T�rk�e dublaj film
  • film izle
  • film izle
  • baglan film izle
  • sinema izle
  • 1080 film izle
  • film mercegi