30 ultimix.forms.enter_processor =
function( e , Id )
34 document.getElementById( Id ).submit();
45 ultimix.forms.enter_was_pressed =
function( e )
47 return( e.keyCode == 13 );
60 ultimix.forms.triple_set_checkbox_click =
function( Id , Name )
62 var Checkbox = document.getElementById(
'_checkbox_' + Id );
63 var Value = document.getElementById( Id );
65 if( Value.value == 0 )
67 jQuery( Checkbox ).prop(
'checked' ,
true );
68 Checkbox.disabled =
false;
73 if( Value.value == 1 )
75 jQuery( Checkbox ).prop(
'checked' ,
true );
76 Checkbox.disabled =
true;
81 if( Value.value == 2 )
83 jQuery( Checkbox ).prop(
'checked' ,
false );
84 Checkbox.disabled =
false;
99 ultimix.forms.double_set_checkbox_click =
function( Id , Name )
101 var Checkbox = document.getElementById(
'_checkbox_' + Id );
102 var Value = document.getElementById( Id );
104 if( Value.value == 0 )
106 jQuery( Checkbox ).prop(
'checked' ,
true );
111 if( Value.value == 1 )
113 jQuery( Checkbox ).prop(
'checked' ,
false );
130 ultimix.forms.set_action_and_method =
function( FormId , Action , Method )
134 document.getElementById( FormId ).setAttribute(
'action' , Action );
138 document.getElementById( FormId ).setAttribute(
'method' , Method );
155 ultimix.forms.submit_form_and_wait =
function( FormId , Action , Waiting , Method )
157 ultimix.forms.set_action_and_method( FormId , Action , Method );
159 document.getElementById( FormId ).submit();
163 ultimix.std_dialogs.SimpleWaitingMessageBox();
176 ultimix.forms.confirm_submit =
function( ConfirmString , Success )
180 ultimix.std_dialogs.QuestionMessageBox( ConfirmString , Success );
184 Success(
ultimix.std_dialogs.MB_YES );
196 ultimix.forms.form_exists =
function( FormId )
198 if( document.getElementById( FormId ) == null )
200 ultimix.std_dialogs.ErrorMessageBox(
'Form ' + FormId +
' was not found' );
221 ultimix.forms.submit_form_0 =
function( FormId , ConfirmString , Action , Waiting , Method )
223 if( !
ultimix.forms.form_exists( FormId ) )
227 var Success =
function( Result )
229 if( Result ==
ultimix.std_dialogs.MB_YES )
231 ultimix.forms.submit_form_and_wait( FormId , Action , Waiting , Method );
234 ultimix.forms.confirm_submit( ConfirmString , Success );
246 ultimix.forms.item_exists =
function( Name )
248 if( document.getElementById( Name ) == null )
250 ultimix.std_dialogs.ErrorMessageBox(
'Field ' + Name +
' was not found' );
275 ultimix.forms.submit_form_1 =
function( FormId , Param1 , Value1 , ConfirmString , Action , Waiting , Method )
277 if( !
ultimix.forms.form_exists( FormId ) || !
ultimix.forms.item_exists( Param1 ) )
281 var Success =
function( Result )
283 if( Result ==
ultimix.std_dialogs.MB_YES )
285 document.getElementById( Param1 ).setAttribute(
'value' , Value1 );
286 ultimix.forms.submit_form_and_wait( FormId , Action , Waiting , Method );
289 ultimix.forms.confirm_submit( ConfirmString , Success );
315 ultimix.forms.submit_form_2 =
function( FormId , Param1 , Value1 , Param2 , Value2 ,
316 ConfirmString , Action , Waiting , Method )
318 if( !
ultimix.forms.form_exists( FormId ) || !
ultimix.forms.item_exists( Param1 ) ||
319 !
ultimix.forms.item_exists( Param2 ) )
323 var Success =
function( Result )
325 if( Result ==
ultimix.std_dialogs.MB_YES )
327 document.getElementById( Param1 ).setAttribute(
'value' , Value1 );
328 document.getElementById( Param2 ).setAttribute(
'value' , Value2 );
329 ultimix.forms.submit_form_and_wait( FormId , Action , Waiting , Method );
332 ultimix.forms.confirm_submit( ConfirmString , Success );
362 ultimix.forms.submit_form_3 =
function( FormId , Param1 , Value1 , Param2 , Value2 , Param3 , Value3 ,
363 ConfirmString , Action , Waiting , Method )
365 if( !
ultimix.forms.form_exists( FormId ) || !
ultimix.forms.item_exists( Param1 ) ||
366 !
ultimix.forms.item_exists( Param2 ) || !
ultimix.forms.item_exists( Param3 ) )
370 var Success =
function( Result )
372 if( Result ==
ultimix.std_dialogs.MB_YES )
374 document.getElementById( Param1 ).setAttribute(
'value' , Value1 );
375 document.getElementById( Param2 ).setAttribute(
'value' , Value2 );
376 document.getElementById( Param3 ).setAttribute(
'value' , Value3 );
377 ultimix.forms.submit_form_and_wait( FormId , Action , Waiting , Method );
380 ultimix.forms.confirm_submit( ConfirmString , Success );
392 ultimix.forms.get_item_value =
function( Item )
394 var TagName =
jQuery( Item ).prop(
'tagName' ).toLowerCase();
399 return(
jQuery( Item ).val() );
401 var Type =
jQuery( Item ).prop(
'type' ).toLowerCase();
402 if( Type ==
'checkbox' )
404 return(
jQuery( Item ).prop(
'checked' ) ? 1 : 0 );
406 if( ( Type ==
'radio' &&
jQuery( Item ).prop(
'checked' ) ) || Type ==
'text' ||
407 Type ==
'hidden' || Type ==
'password' )
409 return(
jQuery( Item ).val() );
423 ultimix.forms.extract_form_data =
function( Selector )
425 var Items =
jQuery( Selector ).find(
'*' ).andSelf();
426 var Data =
new Object();
428 for( var i = 0 ; i < Items.length ; i++ )
430 if(
jQuery( Items[ i ] ).attr(
'name' ) )
432 Data[
jQuery( Items[ i ] ).attr(
'name' ) ] =
ultimix.forms.get_item_value( Items[ i ] );
450 ultimix.forms.update_record =
function( id , Prefix , Method )
453 Prefix +
'_form' , Prefix +
'_context_action' ,
'update_record_form' , Prefix +
'_record_id' ,
454 id ,
'' ,
'' ,
false , Method
467 ultimix.forms.cancel_search =
function( ElementId , Speed )
469 if( document.getElementById(
'search_string' ).value ==
'' )
471 ultimix.ToggleElement( ElementId , Speed );
475 document.getElementById(
'search_string' ).value =
'';
476 window.location.href = window.location.href;
489 ultimix.forms.move_value_to =
function( Obj , DestinationObjectId )
491 document.getElementById( DestinationObjectId ).value = Obj.value;