Jump to content

Writing a Script to Produce Outcome


dinoslikeroar

Recommended Posts

How can I take this below and put it into a script that includes this file and makes sure that it gives a date? I need to check to make sure the function is producing a date. Right now when clicking on the field Complete or Cancel it doesn't produce the date it use to but doesn't anymore. 

$today_plus_five = maj_get_nth_business_day_from_now(5);
$today_plus_twenty = maj_get_nth_business_day_from_now(20);

$page_javascript .= "
function set_action_date(action_date)  {
   document.getElementById('date_action_needed').value=action_date;
}

$(function() {
   $.datepicker.setDefaults($.datepicker.regional['']);
   $('#date_action_needed').datepicker();
   $('#date_action_needed').datepicker('option', {dateFormat: 'm/d/yy'});
});

                 ";

$processing_type_radios = "<input type='radio' name='processing_type' value='Complete' onclick='set_action_date(\"$today_plus_five\")' ";
if ($processing_type == "Complete") $processing_type_radios .= " CHECKED  ";
$processing_type_radios .= "> Complete";
$processing_type_radios .= "<input type='radio' name='processing_type' value='Cancel' onclick='set_action_date(\"$today_plus_twenty\")'";
if ($processing_type == "Cancel") $processing_type_radios .= " CHECKED  ";
$processing_type_radios .= "> Cancel";
Link to comment
Share on other sites

Huh?

 

Not only do I not follow what you are saying, but your code is such an incomplete snippet that it makes no sense at all.

 

You're building some kind of JQ code in your php logic (instead of just outputting it as part of your resulting web page) but you create some html elements that we have no idea of where they end up.

 

Really - perhaps you could be a little clearer in your question?

 

PS - I love the title! "Writing a script to produce outcome". Isn't that what EVERYONE does?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.