Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7755061
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T12:28:22+00:00 2026-06-01T12:28:22+00:00

I am validating my form using SSJS from a submit button. To display the

  • 0

I am validating my form using SSJS from a submit button. To display the error to the user I am using the extension library dialog box.

How can I set the focus to the field failing validation, using SSJS?

One thing I might be able to do is use CSJS in the OK button of the dialog box. I close it with the OK button as follows:

var errorField = '#{javascript:viewScope.get("errorField")}';

I tried the following but it does not seem to work.

if (errorField != null &&  errorField != "")
{   
var ef = document.getElementsByName("#{id:" + errorField + "}");
ef.focus();

}

I am setting the scope variable errorField when I do the actual validation.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T12:28:23+00:00Added an answer on June 1, 2026 at 12:28 pm

    Yes my bad on the missing colon. Ok tried it out and it doesn’t seem to be working for me either when I break up the id expression.

    you have a viewScope set to the id of the error field, is it possible for you to set that to :

    getComponent('...').getClientId();
    

    if you could do that the you would be able to run:

    var errorField = '#{javascript:viewScope.get("errorField")}';
    
    var ef = dojo.byId(errorField);
    ef.focus();
    

    that works fine for me.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Lightbox Gone Wild to display a modal dialog with a form
I'm validating a form using a CustomValidator so I can colour the background of
I'm using happy.js for form validation. When an error occurs, a span with the
I am validating form using jquery validation plugin...... rules: { Name: required, MobileNo: {
Currently i am validating the validation form for phone number using the following code
I'm using Stripes and I am validating the values of a drop down box
I am using Jquery valdiation plugin for validating the form at client side. I
I am using https://github.com/bcardarella/client_side_validations to validate my sign up form. I am validating the
submitHandler: function (form) { form.submit(); // jQuery(form).submit(); window.close(); } I am using the above
I am validating a form using PHP like this (part of it): if (!($email)){

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.