Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

need help to this request urgent plzz

New Here ,
Dec 08, 2009 Dec 08, 2009

Hi i am new to coldfusion i had a form and in form we have two date fields like date1------------ to date2----------------  and i   need to make the second date field default to 7 calendar days from the first date field that was entered.The new date field needs to be non changale

any help regarding this

thanks.

TOPICS
Getting started
1.7K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 08, 2009 Dec 08, 2009

Is it necessary for the user to see the date that is 7 days in the future?  If that second date is being stored, maybe you can just calculate it on submission?

If the dates can be flexible, here's a neat jquery option to ensure the end date is not before the start date.

http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/datePickerStartEnd.html

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 08, 2009 Dec 08, 2009

yes the user has to see the future date and also user is not allowed to change that date that means we have to disable the second date field when user enters date in first field.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Dec 08, 2009 Dec 08, 2009

Actually it sounds like you want it to always be disabled, which the disable parameter or form controls handles fairly well.

Then you would just use JavaScript date functions to calcualte the 7 day date when the first field is completed and dislplay it in the second field.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 08, 2009 Dec 08, 2009

thanks lan ,any help regarding this i am new to coldfuison and these stuff thanks

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Dec 08, 2009 Dec 08, 2009

The first major point is that this is a JavaScript solution that only applies to ColdFusion because it will deliver it to the client along with whatever HTML your page will contain.

JavaScript date object

http://www.w3schools.com/jS/js_obj_date.asp

http://www.w3schools.com/jsref/jsref_obj_date.asp

Input Control

http://www.w3schools.com/tags/tag_input.asp

and its disable property.

http://www.w3schools.com/tags/att_input_disabled.asp

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 11, 2009 Dec 11, 2009

i made my text box disabled but i have no idea how to do when a date is selected in first text field then how to populate 7 future days date in second text field any help with this idea.............

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 12, 2009 Dec 12, 2009

Kirannaga, there is no need for us to re-invent the wheel. You will find the answer in the thread "Advance date 90 days when date change in Form".

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 14, 2009 Dec 14, 2009

Thanks BKBK for ur help but i had problem with this

because i had a componet that is used to select date ie datepicker so when i try to do this i am getting

error , below is my code , would u please help me

<cfform name="dateForm" id="dateForm">
<table>
    <td width="440">
    <cfinput type="text"
                   name="avDateFrom"
                   message="Job Available Date missing - please reenter in the mm/dd/yyyy format."
                   validate="date"
                   required="Yes"
                   size="10" > <cf_calendar datefield="avDateFrom">

    <span id="label"> through </span>

    <cfinput type="Text"
                   name="avDateTo"
                   message="Position Available date is missing, please reenter in the mm/dd/yyyy format.  "
                   validate="date"                 
                   size="10" bind="javascript:addDays({dateForm:avDateFrom})" ><img align="absbottom" src="/media/701/calendar.gif" alt="date"/>
    </td>

</table>

</cfform>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 14, 2009 Dec 14, 2009
i am getting error

Which?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 14, 2009 Dec 14, 2009

this is the error

Bind failed, element not found: avDateFrom [Enable debugging by adding 'cfdebug' to your URL parameters to see more information]

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 14, 2009 Dec 14, 2009

I see that you're also passing the value avDateFrom to the custom tag. Is there more than one field named avDateFrom? What happens when you temporarily comment out the custom tag?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 14, 2009 Dec 14, 2009

there are no more fieldname with avDateFrom,but when i commented the customtag i am not able to select date , i need to select date from using this custom tag only. because we have all the forms with same custom tag that is used for date selections.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 17, 2009 Dec 17, 2009

any help regarding this issue ?


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 17, 2009 Dec 17, 2009

What do you want to achieve? In particular, what do the form fields stand for, and what does the custom tag do?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 17, 2009 Dec 17, 2009

the form field is for just puttind date and the custom tag will will give thedate picker that is populated so that we will select the date from that.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 17, 2009 Dec 17, 2009
LATEST

You could just make the form field avDateFrom and avDateTo to be of type datefield, instead of text

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources