Jump to content

psytae

New Members
  • Posts

    3
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

psytae's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. the <body > field is in my overall header file so if I added that <body onload="toggle_all_day_event()"> it would go off every page that was loaded which I don't want. unless you can do a <body onload="toggle_all_day_event()"> inside another body in html I don't think that will work. Doing some research on the onload function and I found that it should work with <script> as well so I tried chaing the php to $all_day_check = "<input type='checkbox' name='calAllDay' value='ON' onclick='toggle_all_day_event()' />"; and the top of the html file <script onload="toggle_all_day_event()" type="text/javascript"> function toggle_all_day_event() { if( document.postform.calAllDay.checked ) { document.postform.calMEnd.disabled=true; document.postform.calDEnd.disabled=true; document.postform.calYEnd.disabled=true; document.postform.calHr.disabled=true; document.postform.calMn.disabled=true; document.postform.calHrEnd.disabled=true; document.postform.calMnEnd.disabled=true; } else { document.postform.calMEnd.disabled=false; document.postform.calDEnd.disabled=false; document.postform.calYEnd.disabled=false; document.postform.calHr.disabled=false; document.postform.calMn.disabled=false; document.postform.calHrEnd.disabled=false; document.postform.calMnEnd.disabled=false; } } } page loads just fine with no errors, the checkbox is unchecked, like before, but the fields on page load are still disabled until I click the checkbox to turn it on once and then off. Its like it doesn't know how to process NULL and treats it like its ON/Checked even though it isn't yet.
  2. I am modifying someone else's code to do this website and I am not sure how to do this correctly in html5 and php. This is how it currently is. /*------------------------------------------------------------------ Begin to find start/end times NOTE: if s_date_time_opts is false we are editing all events and there will not be any data to get -------------------------------------------------------------------*/ if( $s_date_time_opts ) { if( request_var('calAllDay', '') == "ON" ) { $event_start_date = 0; $event_end_date = 0; $event_data['event_all_day'] = 1; $event_data['event_day'] = sprintf('%2d-%2d-%4d', $date['day'], $date['month_no'], $date['year']); $sort_timestamp = gmmktime( 0,0,0,$date['month_no'], $date['day'], $date['year']); } else { $start_hr = request_var('calHr', 0); $start_mn = request_var('calMn', 0); $event_start_date = gmmktime($start_hr, $start_mn, 0, $date['month_no'], $date['day'], $date['year'] ) - $user->timezone - $user->dst; $sort_timestamp = $event_start_date; $end_m = request_var('calMEnd', 0); $end_d = request_var('calDEnd', 0); $end_y = request_var('calYEnd', 0); $end_hr = request_var('calHrEnd', 0); $end_mn = request_var('calMnEnd', 0); $event_end_date = gmmktime($end_hr, $end_mn, 0, $end_m, $end_d, $end_y ) - $user->timezone - $user->dst; $event_data['event_all_day'] = 0; $event_data['event_day'] = ''; // validate start and end times if( $event_end_date < $event_start_date ) { $error[] = $user->lang['NEGATIVE_LENGTH_EVENT']; } else if( $event_end_date == $event_start_date ) { $error[] = $user->lang['ZERO_LENGTH_EVENT']; } } $event_data['event_start_time'] = $event_start_date; $event_data['event_end_time'] = $event_end_date; $event_all_day = $event_data['event_all_day']; $event_day = $event_data['event_day']; } /*------------------------------------------------------------------ End start/end times -------------------------------------------------------------------*/ and an input field in the same php file $all_day_check = "<input type='checkbox' name='calAllDay' value='ON' clicked='clicked' onclick='toggle_all_day_event()' />"; some javascript in the html file function toggle_all_day_event() { if( document.postform.calAllDay.checked ) { document.postform.calMEnd.disabled=true; document.postform.calDEnd.disabled=true; document.postform.calYEnd.disabled=true; document.postform.calHr.disabled=true; document.postform.calMn.disabled=true; document.postform.calHrEnd.disabled=true; document.postform.calMnEnd.disabled=true; } else { document.postform.calMEnd.disabled=false; document.postform.calDEnd.disabled=false; document.postform.calYEnd.disabled=false; document.postform.calHr.disabled=false; document.postform.calMn.disabled=false; document.postform.calHrEnd.disabled=false; document.postform.calMnEnd.disabled=false; } } and some html further down in the html file <fieldset class="fields1"> <dl style="clear: left;"> <dt><label>All Day Event:</label></dt> <dd>{ALL_DAY_CHECK}</dd> </dl> </fieldset> First off I would like the All Day Event checkbox currently on the page to be hidden and unchecked by default, or baring that unchecked and the disabled fields to be enabled and if checked later to disable the fields. I thought I might be able to initialize the calAllDay variable earlier in the php file with this // Intialize Calendar All Day Event to Off $calAllDay = 'OFF'; and change the input checkbox to this $all_day_check = "<input type='checkbox' name='calAllDay' value='ON' onclick='toggle_all_day_event()' />"; but the behavior of this sets the checkbox to unchecked (like I could live with) but the disabled fields in the form are still disabled untill I check the checkbox and then uncheck it again. I want the fields to be enabled on load.
  3. I have a web page that uses $_POST to pass the ID from web page to web page as they fill out forms using $ID=$_POST['id'] The last page of the form passes this and other information to a php page that inserts the information that was passed into a database I have set up and then redirects back to the first page of the form. This is what I have so far. <?php // Change to the URL you want to redirect to$URL="Start.php"; header ("Location: $URL"); $ID=$_POST['id'];?> What I want to happen however is when it redirects, I want it to pass the ID information back to the main page again as well. Can anyone help me out?
×
×
  • 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.