Page 1 of 1

Some questions and two solutions

Posted: Fri Aug 16, 2019 7:36 pm
by Massimo Linossi
Hi.
I have some questions on how to solve some little way of programming with mod_harbour.
1- input numbers with formatting.
2- validating an input text field like the valid in harbour (going to a function for reading a table, looking for a code and returning back a string to place near the field on the form)
3- testing for browser in use

The th tag for tables in not left align but always centered in Safari. For solving you must use the td tag with strong style.
I spent a lot of time for input date fields, because with the datepicker is different on every browser. I'm making some tests but probably I have solved the problem.
In the next day I'll publish some code for making the date input works correctly.
Thanks a lot.
Massimo

Re: Some questions and two solutions

Posted: Sat Aug 17, 2019 6:10 am
by Antonio Linares

Re: Some questions and two solutions

Posted: Sat Aug 17, 2019 6:13 am
by Antonio Linares
2. With this javascript code you can call a PRG from javascript:

Code: Select all

function RunCode( cCode, cResultId )
{
   var o = new Object();
   var cResult;
   
   if( cResultId == null )
      cResultId = "#memo";
   
   o[ 'source' ] = atob( cCode );
   console.log( 'PARAM', o );
            
   $.post( "run.prg", o )
      .done( function( data ) { console.log( 'DONE', data ); $( cResultId ).html( data ); } )
      .fail( function( data ) { console.log( 'ERROR', data ); } );
}