• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Pop Up Calendar Would be helpful

Pop Up Calendar Would be helpful 17 years 2 months ago #2250

  • richiep
  • richiep's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 131
I'd like to see a pop up calendar too.<br><br>Post edited by: richiep, at: 2008/03/04 23:44
The administrator has disabled public write access.

Re:Pop Up Calendar Would be helpful 17 years 1 month ago #2288

  • richiep
  • richiep's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 131
While it would be nice to have a calendar pop up as part of RSfrom it's not to hard to install a third party component. I found this one which was fairly easy to install www.softcomplex.com/products/tigra_calendar/

Happy coding
Rich
The administrator has disabled public write access.

Re:Pop Up Calendar Would be helpful 17 years 1 month ago #2291

  • richiep
  • richiep's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 131
While it would be nice to have a calendar pop up as part of RSfrom it's not to hard to install a third party component. I found this one which was fairly easy to install www.softcomplex.com/products/tigra_calendar/

Happy coding
Rich
The administrator has disabled public write access.

Re:Pop Up Calendar Would be helpful 17 years 3 weeks ago #2694

So there is no way to make the calendar field in the 1.5 component a pop-up calendar?
The administrator has disabled public write access.

Re:Pop Up Calendar Would be helpful 17 years 2 weeks ago #2741

Actually, J 1.5 includes a pop-up calendar for form fields - this one line of code can wipe out all that custom calendar code for calendar fields:
echo JHTML::_('calendar', \"\", $row->name, txt.$row->name);

I just can't figure out how to get it so it positions properly. I've put it into the case statement for calendar but the fields are appearing at the top of the form, not next to their labels.

Here is what I have done with forme.html.php:
&lt;?php
/**
* @version 1.0.4
* @package RSform! 1.0.4
* @copyright (C) 2007 www.rsjoomla.com
* @license Commercial License, http://www.rsjoomla.com/license/forme.html
*/
 
defined( '_JEXEC' ) or die( 'Restricted access' );
 
class forme_HTML{
	function test(){
	}
	function thankyou($form, $Itemid, $did, $fid){
 
		$return_url = ($form-&gt;return_url == '') ?  str_replace( '&', '&amp;', sefRelToAbs(\&quot;index.php?option=com_forme&amp;Itemid=$Itemid&amp;fid=$fid\&quot;«»)) : $form-&gt;return_url;
 
		echo '&lt;div class=\&quot;thankyou\&quot;&gt;'.stripslashes($form-&gt;thankyou).'&lt;/div&gt;';
 
		echo '&lt;input type=\&quot;button\&quot; name=\&quot;ok\&quot; value=\&quot;'._FORME_FRONTEND_THANKYOU_BUTTON.'\&quot; onclick=\&quot;document.location=\''.$return_url.'\'\&quot;/&gt;';
	}
 
	function showForm($option, &amp;$form, &amp;$fields){
		global  $Itemid, $mainframe, $params, $hide_js, $pop, $formeConfig;
 
		$database =&amp; JFactory::getDBO();
 
		//Page title
		$mainframe-&gt;setPageTitle( $form-&gt;title );
    	$mainframe-&gt;addMetaTag( 'title' , $form-&gt;title );
 
    	//mosCommonHTML::loadCalendar();
 
    	eval($form-&gt;script_display);
 
    	//if we have upload file fields, add enctype
    	$enctype='';
	    foreach($fields as $field){
	    	if($field-&gt;inputtype=='file upload') $enctype = ' enctype=\&quot;multipart/form-data\&quot;';
	    }
 
 
		//parse field template
		$formfields = '';
		foreach($fields as $field){
			if($form-&gt;fieldstyle=='') $form-&gt;fieldstyle = _FORME_BACKEND_EDITFORMS_FIELDSTYLE_DEFAULT;
			if($field-&gt;fieldstyle=='') $field-&gt;fieldstyle = $form-&gt;fieldstyle;
			$formfields .= forme_HTML::«»parseFields($field);
		}
 
 
		$action = str_replace( '&', '&amp;', sefRelToAbs('index.php?option=com_forme&amp;fid='.$form-&gt;id.'&amp;Itemid='.$Itemid));
 
		//parse form template
		if($form-&gt;formstyle == '') $form-&gt;formstyle = _FORME_BACKEND_EDITFORMS_STYLE_DEFAULT;
		$form-&gt;formstyle = str_replace('{formtitle}',$form-&gt;title,$form-&gt;formstyle);
		$form-&gt;formstyle = str_replace('{formname}',$form-&gt;name,$form-&gt;formstyle);
		$form-&gt;formstyle = str_replace('{enctype}',$enctype,$form-&gt;formstyle);
		$form-&gt;formstyle = str_replace('{action}',$action,$form-&gt;formstyle);
 
		$form-&gt;formstyle = str_replace('{formfields}',$formfields,$form-&gt;formstyle);
 
		echo $form-&gt;formstyle;
	}
 
	function parseErrorMsg($fieldid){
		$error = '';
		if(isset($_SESSION['formmsg'][$fieldid])){
			if(!empty($_SESSION['formmsg'][$fieldid])){
				foreach($_SESSION['formmsg'][$fieldid] as $i=&gt;$errmsg){
					$_SESSION['formmsg'][$fieldid][$errmsg] = $errmsg;
					unset($_SESSION['formmsg'][$fieldid][$i]);
				}
				foreach($_SESSION['formmsg'][$fieldid] as $errmsg){
					$error .= '&lt;br/&gt;&lt;span style=\&quot;color: #CF4D4D;font-weight:bold;font-size:10px;\&quot;&gt;'.$errmsg.'&lt;/span&gt;';
				}
				unset($_SESSION['formmsg'][$fieldid]);
			}
		}
		return $error;
	}
 
	function parseFields($row){
 
		$html = '';
		if(!isset($_SESSION['formdata'])) $_SESSION['formdata'] = array();
		switch($row-&gt;inputtype){
			case 'text':
				if(isset($_SESSION['formdata'][$row-&gt;name])){
					$row-&gt;default_value = stripslashes($_SESSION['formdata'][$row-&gt;name]);
 
				}
 
				$errmsg = forme_HTML::«»parseErrorMsg($row-&gt;name);
				$html = str_replace('{fieldtitle}',$row-&gt;title,$row-&gt;fieldstyle);
				$html = str_replace('{validationsign}',($row-&gt;validation_rule) ? ' *':'',$html);
				$html = str_replace('{field}','&lt;input type=\&quot;text\&quot; name=\&quot;form['.$row-&gt;name.']\&quot; value=\&quot;'.$row-&gt;default_value.'\&quot; id=\&quot;'.$row-&gt;name.'\&quot; '.$row-&gt;params.' /&gt;'.$errmsg,$html);
				$html = str_replace('{fielddesc}',$row-&gt;description,$html);
			break;
			case 'button':
				$html = str_replace('{fieldtitle}',$row-&gt;title,$row-&gt;fieldstyle);
				$html = str_replace('{validationsign}',($row-&gt;validation_rule) ? ' *':'',$html);
				$html = str_replace('{field}','&lt;input type=\&quot;button\&quot; name=\&quot;form['.$row-&gt;name.']\&quot; value=\&quot;'.$row-&gt;default_value.'\&quot; id=\&quot;'.$row-&gt;name.'\&quot; '.$row-&gt;params.' /&gt;',$html);
				$html = str_replace('{fielddesc}',$row-&gt;description,$html);
			break;
			case 'reset button':
				$html = str_replace('{fieldtitle}',$row-&gt;title,$row-&gt;fieldstyle);
				$html = str_replace('{validationsign}',($row-&gt;validation_rule) ? ' *':'',$html);
				$html = str_replace('{field}','&lt;input type=\&quot;reset\&quot; name=\&quot;form['.$row-&gt;name.']\&quot; value=\&quot;'.$row-&gt;default_value.'\&quot; id=\&quot;'.$row-&gt;name.'\&quot; '.$row-&gt;params.' /&gt;',$html);
				$html = str_replace('{fielddesc}',$row-&gt;description,$html);
			break;
			case 'submit button':
				$html = str_replace('{fieldtitle}',$row-&gt;title,$row-&gt;fieldstyle);
				$html = str_replace('{validationsign}',($row-&gt;validation_rule) ? ' *':'',$html);
				$html = str_replace('{field}','&lt;input type=\&quot;submit\&quot; name=\&quot;form['.$row-&gt;name.']\&quot; value=\&quot;'.$row-&gt;default_value.'\&quot; id=\&quot;'.$row-&gt;name.'\&quot; '.$row-&gt;params.' /&gt;',$html);
				$html = str_replace('{fielddesc}',$row-&gt;description,$html);
			break;
			case 'image button':
				$html = str_replace('{fieldtitle}',$row-&gt;title,$row-&gt;fieldstyle);
				$html = str_replace('{validationsign}',($row-&gt;validation_rule) ? ' *':'',$html);
				$html = str_replace('{field}','&lt;input type=\&quot;image\&quot; name=\&quot;form['.$row-&gt;name.']\&quot; src=\&quot;'.$row-&gt;default_value.'\&quot; id=\&quot;'.$row-&gt;name.'\&quot; '.$row-&gt;params.' /&gt;',$html);
				$html = str_replace('{fielddesc}',$row-&gt;description,$html);
			break;
			case 'hidden':
				$html = str_replace('{fieldtitle}',$row-&gt;title,$row-&gt;fieldstyle);
				$html = str_replace('{validationsign}',($row-&gt;validation_rule) ? ' *':'',$html);
				$html = str_replace('{field}','&lt;input type=\&quot;hidden\&quot; name=\&quot;form['.$row-&gt;name.']\&quot; value=\&quot;'.$row-&gt;default_value.'\&quot; id=\&quot;'.$row-&gt;name.'\&quot; '.$row-&gt;params.' /&gt;',$html);
				$html = str_replace('{fielddesc}',$row-&gt;description,$html);
			break;
			case 'file upload':
				$errmsg = forme_HTML::«»parseErrorMsg($row-&gt;name);
				$html = str_replace('{fieldtitle}',$row-&gt;title,$row-&gt;fieldstyle);
				$html = str_replace('{validationsign}',($row-&gt;validation_rule) ? ' *':'',$html);
				$html = str_replace('{field}','&lt;input type=\&quot;file\&quot; name=\&quot;form['.$row-&gt;name.']\&quot; value=\&quot;\&quot; id=\&quot;'.$row-&gt;name.'\&quot; '.$row-&gt;params.' /&gt;'.$errmsg,$html);
				$html = str_replace('{fielddesc}',$row-&gt;description,$html);
			break;
			case 'password':
				$errmsg = forme_HTML::«»parseErrorMsg($row-&gt;name);
				$html = str_replace('{fieldtitle}',$row-&gt;title,$row-&gt;fieldstyle);
				$html = str_replace('{validationsign}',($row-&gt;validation_rule) ? ' *':'',$html);
				$html = str_replace('{field}','&lt;input type=\&quot;password\&quot; name=\&quot;form['.$row-&gt;name.']\&quot; value=\&quot;'.$row-&gt;default_value.'\&quot; id=\&quot;'.$row-&gt;name.'\&quot; '.$row-&gt;params.' /&gt;'.$errmsg,$html);
				$html = str_replace('{fielddesc}',$row-&gt;description,$html);
			break;
			case 'radio':
 
				$errmsg = forme_HTML::«»parseErrorMsg($row-&gt;name);
				if(isset($_SESSION['formdata'][$row-&gt;name])) $row-&gt;default_value = str_replace('{checked}','',$row-&gt;default_value);
 
				$row-&gt;default_value = explode(',',$row-&gt;default_value);
				$radios = '';
				foreach ($row-&gt;default_value as $i=&gt;$radioset){
					$valTitle = explode('|',$radioset);
					if(!isset($valTitle[1])) $valTitle[1] = $valTitle[0];
					if(isset($_SESSION['formdata'][$row-&gt;name])){
						if($_SESSION['formdata'][$row-&gt;name]==$valTitle[0]){
							$valTitle[0] = $valTitle[0].'\&quot; checked=\&quot;checked';
						}
					}else{
						$valTitle[0] = str_replace('{checked}','\&quot; checked=\&quot;checked',$valTitle[0]);
					}
 
					$radios .= '&lt;span class=\&quot;radio'.$row-&gt;name.'\&quot; style=\&quot;white-space: nowrap\&quot;&gt;&lt;input type=\&quot;radio\&quot; name=\&quot;form['.$row-&gt;name.']\&quot; id=\&quot;'. $row-&gt;name .$i. '\&quot; value=\&quot;'.$valTitle[0].'\&quot; '.$row-&gt;params.' /&gt;&lt;label for=\&quot;'. $row-&gt;name .$i. '\&quot;&gt;'. $valTitle[1].'&lt;/label&gt;&lt;/span&gt;';
				}
				$html = str_replace('{fieldtitle}', $row-&gt;title, $row-&gt;fieldstyle);
				$html = str_replace('{validationsign}', ($row-&gt;validation_rule) ? ' *':'', $html);
				$html = str_replace('{field}', $radios.$errmsg, $html);
				$html = str_replace('{fielddesc}', $row-&gt;description, $html);
			break;
			case 'checkbox':
				$errmsg = forme_HTML::«»parseErrorMsg($row-&gt;name);
				if(isset($_SESSION['formdata'][$row-&gt;name])) $row-&gt;default_value = str_replace('{checked}','',$row-&gt;default_value);
 
				$row-&gt;default_value = explode(',',$row-&gt;default_value);
				$checks = '';
				foreach ($row-&gt;default_value as $i=&gt;$checkset){
					$valTitle = explode('|',$checkset);
					if(!isset($valTitle[1])) $valTitle[1] = $valTitle[0];
					if(isset($_SESSION['formdata'][$row-&gt;name])){
						foreach($_SESSION['formdata'][$row-&gt;name] as $val){
							if($val==$valTitle[0]){
								$valTitle[0] = $valTitle[0].'\&quot; checked=\&quot;checked';
							}
						}
					}else{
						$valTitle[0] = str_replace('{checked}','\&quot; checked=\&quot;checked',$valTitle[0]);
					}
					$checks .= '&lt;span class=\&quot;check'.$row-&gt;name.'\&quot; style=\&quot;white-space: nowrap\&quot;&gt;&lt;input type=\&quot;checkbox\&quot; name=\&quot;form['.$row-&gt;name.'][]\&quot; id=\&quot;'. $row-&gt;name .$i. '\&quot; value=\&quot;'.$valTitle[0].'\&quot; '.$row-&gt;params.' /&gt;&lt;label for=\&quot;'. $row-&gt;name .$i. '\&quot;&gt;'. $valTitle[1].'&lt;/label&gt;&lt;/span&gt;';
				}
				$html = str_replace('{fieldtitle}',$row-&gt;title,$row-&gt;fieldstyle);
				$html = str_replace('{validationsign}',($row-&gt;validation_rule) ? ' *':'',$html);
				$html = str_replace('{field}', $checks.$errmsg, $html);
				$html = str_replace('{fielddesc}',$row-&gt;description,$html);
			break;
			case 'textarea':
				if(isset($_SESSION['formdata'][$row-&gt;name])){
					$row-&gt;default_value = stripslashes($_SESSION['formdata'][$row-&gt;name]);
 
				}
				$errmsg = forme_HTML::«»parseErrorMsg($row-&gt;name);
				$html = str_replace('{fieldtitle}',$row-&gt;title,$row-&gt;fieldstyle);
				$html = str_replace('{validationsign}',($row-&gt;validation_rule) ? ' *':'',$html);
				$html = str_replace('{field}','&lt;textarea name=\&quot;form['.$row-&gt;name.']\&quot; id=\&quot;'.$row-&gt;name.'\&quot; '.$row-&gt;params.'&gt;'.$row-&gt;default_value.'&lt;/textarea&gt;'.$errmsg,$html);
				$html = str_replace('{fielddesc}',$row-&gt;description,$html);
			break;
			case 'select':
				$errmsg = forme_HTML::«»parseErrorMsg($row-&gt;name);
				if(isset($_SESSION['formdata'][$row-&gt;name])) $row-&gt;default_value = str_replace('{checked}','',$row-&gt;default_value);
 
				$options = '';
				$row-&gt;default_value = explode(',',$row-&gt;default_value);
				foreach ($row-&gt;default_value as $optionset){
					$valTitle = explode('|',$optionset);
					if(!isset($valTitle[1])) $valTitle[1] = $valTitle[0];
 
					if(isset($_SESSION['formdata'][$row-&gt;name])){
						foreach($_SESSION['formdata'][$row-&gt;name] as $val){
							if($val==$valTitle[0]){
								$valTitle[0] = $valTitle[0].'\&quot; selected=\&quot;selected';
							}
						}
					}else{
						$valTitle[0] = str_replace('{checked}','\&quot; selected=\&quot;selected',$valTitle[0]);
					}
 
 
					$options .= '&lt;option value=\&quot;'.$valTitle[0].'\&quot;&gt;'.$valTitle[1].'&lt;/option&gt;';
				}
				$html = str_replace('{fieldtitle}',$row-&gt;title,$row-&gt;fieldstyle);
				$html = str_replace('{validationsign}',($row-&gt;validation_rule) ? ' *':'',$html);
				$html = str_replace('{field}','&lt;select name=\&quot;form['.$row-&gt;name.'][]\&quot; '.$row-&gt;params.' id=\&quot;'.$row-&gt;name.'\&quot; &gt;'.$options.'&lt;/select&gt;'.$errmsg,$html);
				$html = str_replace('{fielddesc}',$row-&gt;description,$html);
			break;
 
			case 'calendar':
				if(isset($_SESSION['formdata'][$row-&gt;name])){
					$default_value = $_SESSION['formdata'][$row-&gt;name];
				}else{
					$default_value = '';
				}
				$errmsg = forme_HTML::«»parseErrorMsg($row-&gt;name);
				$html = str_replace('{fieldtitle}',$row-&gt;title,$row-&gt;fieldstyle);
				$html = str_replace('{validationsign}',($row-&gt;validation_rule) ? ' *':'',$html);
				echo JHTML::_('calendar', \&quot;\&quot;, $row-&gt;name, txt.$row-&gt;name);
				$html = str_replace('{field}','&lt;div id=\&quot;'.$row-&gt;name.'Container\&quot;&gt;&lt;/div&gt;&lt;input id=\&quot;txt'.$row-&gt;name.'\&quot; name=\&quot;form['.$row-&gt;name.']\&quot; value=\&quot;'.$default_value.'\&quot; type=\&quot;hidden\&quot;/&gt;'.$errmsg,$html);
 
 
				$html = str_replace('{fielddesc}',$row-&gt;description,$html);
			break;
 
			case 'free text':
				$html = str_replace('{fieldtitle}',$row-&gt;title,$row-&gt;fieldstyle);
				$html = str_replace('{validationsign}','',$html);
				$html = str_replace('{field}',$row-&gt;default_value,$html);
				$html = str_replace('{fielddesc}',$row-&gt;description,$html);
			break;
 
			case 'ticket number':
				$length = (int)$row-&gt;default_value;
				if($length&lt;1||$length&gt;255) $length = 8;
				  $key = \&quot;\&quot;;
				  $possible = \&quot;0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ\&quot;;
				  $i = 0;
				  while ($i &lt; $length) {
				    $key .= substr($possible, mt_rand(0, strlen($possible)-1), 1);
				    $i++;
				  }
 
				$html = str_replace('{fieldtitle}',$row-&gt;title,$row-&gt;fieldstyle);
				$html = str_replace('{validationsign}','',$html);
				$html = str_replace('{field}','&lt;input id=\&quot;'.$row-&gt;name.'\&quot; name=\&quot;form['.$row-&gt;name.']\&quot;  value=\&quot;'.$key.'\&quot; type=\&quot;hidden\&quot;/&gt;',$html);
				$html = str_replace('{fielddesc}',$row-&gt;description,$html);
			break;
			case 'captcha':
				$errmsg = forme_HTML::«»parseErrorMsg($row-&gt;name);
				$html = str_replace('{fieldtitle}',$row-&gt;title,$row-&gt;fieldstyle);
				$html = str_replace('{validationsign}',($row-&gt;validation_rule) ? ' *':'',$html);
				$html = str_replace('{field}','&lt;img src=\&quot;'.JURI :: base().'index.php?option=com_forme&amp;func=captcha\&quot;/&gt;&lt;br/&gt;&lt;input type=\&quot;text\&quot; name=\&quot;form['.$row-&gt;name.']\&quot; value=\&quot;'.$row-&gt;default_value.'\&quot; id=\&quot;'.$row-&gt;name.'\&quot; '.$row-&gt;params.' style=\&quot;width:74px;text-align:center;\&quot; /&gt;'.$errmsg,$html);
				$html = str_replace('{fielddesc}',$row-&gt;description,$html);
			break;
		}
 
		return $html;
	}
 
 
//end of class
}
?&gt;
<br><br>Post edited by: latristesse, at: 2008/04/15 05:44
The administrator has disabled public write access.

Re:Pop Up Calendar Would be helpful 16 years 11 months ago #3166

Hi,

Wanted a pop up calendar too and followed your idea. Encountered the same problem with the position and fixed it by entering this code in the field style of my form field:

<tr>
<td align=\"right\" valign=\"top\">{fieldtitle}{validationsign}</td>
<td valign=\"top\"><input type=\"text\" name=\"Datum\"
id=\"startdate\" size=\"25\" maxlength=\"25\"
value=\"04-06-2008\" />
<input type=\"reset\" value=\"Datum\"
onclick=\"return showCalendar('Datum','%d-%m-%Y');\" />{field}</td>
<td valign=\"top\">{fielddesc}</td>
</tr>

Essential to put the code in the <td> of the {field}. Value option also handles the default value, though this should still be changed to today's date.

Hope this helps!

Cynthia
The administrator has disabled public write access.

Re:Pop Up Calendar Would be helpful 16 years 3 months ago #6101

  • Mr.Jinx
  • Mr.Jinx's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 9
@richiep:

How did you integrate the tigra calendar?
I would also like to use this calendar because of it's extreme configurability (like setting ranges of days a user can pick).
This is the ultimate calendar tool if you ask me!

The script generates a form textfield where it stores the selected date, but how do I get this in rsforms?
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!