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 7707777
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T00:26:47+00:00 2026-06-01T00:26:47+00:00

sorry about input mistakes, english its not my mother lang. I have this code

  • 0

sorry about input mistakes, english its not my mother lang.
I have this code written on normal html that i managed to transform into xhtml file, i want to send the value shown on <input id="f_date"> to <h:inputText>:

<script src="../js/jscal2.js" type="text/javascript" xml:space="preserve"></script>
<script src="../js/lang/en.js" type="text/javascript" xml:space="preserve"></script>
<link rel="stylesheet" type="text/css" href="../css/jscal2.css" />
<link rel="stylesheet" type="text/css" href="../css/border-radius.css" />
<link rel="stylesheet" type="text/css" href="../css/steel/steel.css" />

<h:form id="form1">
  <table>
    <tr>
      <td colspan="4" id="cont"></td>
    </tr>
    <tr>
      <td>
        <input style="text-align: center" name="date" id="f_date"
        size="14" />
        <h:inputText id="f_date" value="#{solicitud.fechaI}" maxlength="10" size="10" valueChangeListener="#{solicitud.fechaIText}">
            <a4j:ajax event="keyup" render="fechaI, fIni" status="statusFI"/>
        </h:inputText>
      </td>
      <td>
        <input style="text-align: center" name="hour" id="f_hour" size="2" />
      </td>
      <td>
        :
      </td>
      <td>
        <input style="text-align: center" name="minute" id="f_minute"
        size="2" />
      </td>
    </tr>
  </table>
</h:form><script type="text/javascript" xml:space="preserve">//<![CDATA[


  function updateFields(cal) {
          var date = cal.selection.get();
          if (date) {
                  date = Calendar.intToDate(date);
                  document.getElementById("f_date").value = Calendar.printDate(date, "%Y-%m-%d");
          }
          document.getElementById("f_hour").value = cal.getHours();
          document.getElementById("f_minute").value = cal.getMinutes();
  };

  Calendar.setup({
          cont         : "cont",
          showTime     : 12,
          onSelect     : updateFields,
          onTimeChange : updateFields
  });

//]]></script>

Thanks in advance, best regards

  • 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-01T00:26:49+00:00Added an answer on June 1, 2026 at 12:26 am

    You should reuse input element from <h:inputText> when setting up JS calendar. Use inputField argument to pass id of input generated by JSF. It could be form1:f_date but check html source to make sure.

    EDIT:

    prefix id with “form1:” in updateFields”

    document.getElementById("form1:f_date")
    

    and get rid of

    <input style="text-align: center" name="date" id="f_date"
           size="14" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sorry about the wording for my question title. I have a basic HTML anchor
I am sorry about the amount of code here. I have tried to show
I'm sorry about the title I'm just not sure how to describe this one.
Sorry about the title, don't know how to phrase this. I have my own
Sorry about the extremely vague question title (any suggestions for improvements welcome) I have
I'm sorry about the naive question. I have the following: public Array Values {
First of all, sorry about that title. I'm not the best at writing those
This is going to sound too silly / too basic - sorry about that,
I have this problem--- Write code that will print a multiplication table for 10
at first sorry about my poor English. Now Im having a problem in closing

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.