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

  • SEARCH
  • Home
  • 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 3672168
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T02:34:33+00:00 2026-05-19T02:34:33+00:00

I have a with a textbox and which submits the modalPanel. On Click of

  • 0

I have a with a textbox and which submits the modalPanel.

On Click of the button, I want to check if the text box has been filled through a JavaScript Function.

Any suggestions..??

Here is the code:
For the modalPanel–

<h:form id="theForm">
<rich:modalPanel id="diskPanel" width="350" height="250">
<f:facet name="header">
    <h:panelGroup>
        <h:outputText value="Create New Disk"></h:outputText>
    </h:panelGroup>
</f:facet>
<h:panelGrid columns="2" width="70%">
    <h:outputLabel value="Disk Name* :" />
    <h:inputText value="#{myform.newDiskName}" id="diskPanel_diskName"/>

    <h:commandButton value="Create-Attach" id="submit_disk" 
           onclick="return validateDiskPanel()"
      action="#{myform.cloudButtonActionRequest('newdisk')}">
    <rich:componentControl for="diskPanel" attachTo="submit_disk"
    operation="hide" event="onclick" />
    </h:commandButton>
</h:panelGrid>

</rich:modalPanel>
    </h:theForm>

Code For the JavaScript Function—

function validateDiskPanel(){ var obj1 = document.getElementById(“theForm:diskPanel_diskName”); var obj2 = document.getElementById(“theForm:diskPanel_diskSize”); if(obj1 == “”){ alert(“Please provide Disk Name”); Richfaces.showModalPanel(‘diskPanel’); return false; } return true; }

  • 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-05-19T02:34:34+00:00Added an answer on May 19, 2026 at 2:34 am

    Use <rich:ajaxValidator>.
    Here is the example.

    Else if you are rigid to use javascript validation then don’t use <rich:componentControl> as the panel will hide on page reload for successful submission.

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

Sidebar

Related Questions

I have an asp.net TextBox in which I want to check if the text
I have a form which has a input textbox and submit button. On submission
I have a textbox which has the code; <input type=text maxlength=5 size=2 value=1 id=paging_textbox>
I have some C# / asp.net code I inherited which has a textbox which
I have UserControl which contains a TextBox and a Button control. The Button opens
I have a user control which has a textbox on it, now this usercontrol
I have some textbox and submit button. When ever I click the submit button
I have created a custom message box with a textbox for input which appears
I have an ASP.NET user control that contains a textbox which has an AJAX
I have the jquery below which basically pre-populates a text box. (It actually populates

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.