]>
git.immae.eu Git - github/wallabag/wallabag.git/blob - inc/3rdparty/libraries/mpdf/examples/example57_new_mPDF_v5-3_active_forms.php
4 include ( "../mpdf.php" );
8 //==============================================================
17 font-family: arialunicodems
23 <form action="http://127.0.0.1/MPDF1.com/common/mpdf/examples/formsubmit.php" method="post">
25 <input type="text" size="90" name="inputfield" value="" title="The title attribute works like a tool-tip" />
29 <input type="text" size="90" name="readonlyfield" value="Read-only field. The value will be exported on submit" title="The title does not do anything if the field is read-only" readonly="readonly" />
33 <input type="text" size="90" name="disabledfield" value="Disabled field. The value will not be exported on submit" title="The title does not do anything if the field is disabled." disabled="disabled" />
37 <input type="text" size="90" name="requiredfield" value="" title="This field must be entered before you can submit." required="required" />
41 <input type="hidden" name="hiddenfield" value="value_of_hidden_field">
45 <input type="password" size="40" name="password" value="mysecretpassword" title="This field is set to act as a password field." >
49 <input type="text" size="20" name="maths1" value="0" onChange="var a = this.getField( \' maths1 \' ).value;
50 var b = this.getField( \' maths2 \' ).value;
51 this.getField( \' maths3 \' ).value = a + b;
53 <input type="text" size="20" name="maths2" value="0" onChange="var a = this.getField( \' maths1 \' ).value;
54 var b = this.getField( \' maths2 \' ).value;
55 this.getField( \' maths3 \' ).value = a + b;
57 <input type="text" size="20" name="maths3" value="" readonly="readonly"/>
62 <textarea name="textareafield" spellcheck="true" rows="5" cols="80" wrap="virtual" title="Textarea tooltip">Quisque viverra. Etiam id libero at magna pellentesque aliquet. Nulla sit amet ipsum id enim tempus dictum. Quisque viverra. Etiam id libero at magna pellentesque aliquet. Nulla sit amet ipsum id enim tempus dictum. Quisque viverra. Etiam id libero at magna pellentesque aliquet. Nulla sit amet ipsum id enim tempus dictum. Quisque viverra. Etiam id libero at magna pellentesque aliquet. Nulla sit amet ipsum id enim tempus dictum. Quisque viverra. Etiam id libero at magna pellentesque aliquet. Nulla sit amet ipsum id enim tempus dictum. Quisque viverra. Etiam id libero at magna pellentesque aliquet. Nulla sit amet ipsum id enim tempus dictum. Quisque viverra. Etiam id libero at magna pellentesque aliquet. Nulla sit amet ipsum id enim tempus dictum. Quisque viverra. Etiam id libero at magna pellentesque aliquet. Nulla sit amet ipsum id enim tempus dictum. </textarea>
67 <select name="first_language" editable="editable" onChange="
68 var choice = this.getField( \' first_language \' ).value;
69 this.getField( \' first_language_display \' ).value = choice;
71 <option value="" >- Please select or type in -</option>
72 <option value="Arabic" >العربية</option>
73 <option value="Bulgarian" >български език</option>
74 <option value="Chinese" >汉语</option>
75 <option value="Czech" >česky</option>
76 <option value="English" >English</option>
77 <option value="French" >Français</option>
78 <option value="Greek" >Ελληνικά</option>
79 <option value="Japanese" >日本語</option>
80 <option value="Latvian" >Latviešu valoda</option>
81 <option value="Russian" >Русско</option>
82 <option value="Spanish" >Español</option>
83 <option value="Turkish" >Türkçe</option>
85
87 You have selected: <input type="text" size="20" name="first_language_display" value="" readonly="readonly"/>
93 <b>Spoken language(s)</b><br />
94 <select size="6" multiple="multiple" name="spoken_languages">
95 <option value="Arabic" >العربية</option>
96 <option value="Bulgarian" >български език</option>
97 <option value="Chinese" >汉语</option>
98 <option value="Czech" >česky</option>
99 <option value="English" selected="selected">English</option>
100 <option value="French" >Français</option>
101 <option value="Greek" >Ελληνικά</option>
102 <option value="Japanese" >日本語</option>
103 <option value="Latvian" >Latviešu valoda</option>
104 <option value="Russian" >Русско</option>
105 <option value="Spanish" >Español</option>
106 <option value="Turkish" >Türkçe</option>
113 <b>How many languages do you speak?</b>
114 <input type="radio" name="num_languages" value="1" checked="checked" > One
115 <input type="radio" name="num_languages" value="2" > Two
116 <input type="radio" name="num_languages" value="3" > Three
117 <input type="radio" name="num_languages" value="4" > Four
118 <input type="radio" name="num_languages" value="5" > Five +
123 <input type="checkbox" name="email" value="email_subscrbe" checked="checked" /> Please send me regular information by e-mail<br>
124 <input type="checkbox" name="phone" value="phone-me" disabled="disabled" /> Please phone me (not available at present)<br>
125 <input type="checkbox" name="subscribe" value="newsletter_subscribe" /> Please subscribe me to the Newsletter
130 Click this button to see Javascript in action:
131 <input type="image" name="imageButton" value="imagesubmitted" src="goto.gif" title="Click to run javascript" onClick="
132 var npass = this.getField( \' password \' ).value;
133 app.alert( \' Value of password field is: \\\'\' + npass + \'\\\'\' );
134 var nButton = app.alert({
135 cMsg: \' Do you want to change the input text field to: T\u00f6rkylempij\u00e4? \' ,
136 cTitle: \' A message from A. C. Robat \' ,
139 if ( nButton == 4 ) {
140 this.getField( \' inputfield \' ).value = \' T\u00f6rkylempij\u00e4 \' ;
146 <input type="submit" name="disabled_submit" value="Disabled" disabled="disabled" title="This Submit button is disabled" />
148 <input type="reset" name="resetfield" value="Reset" />
150 <input type="submit" name="submit" value="Submit" title="Click here to submit" />
152 <input type="submit" name="submit_in_Turkish" value="Submit (Türkçe)" title="Click here to submit in Türkçe" />
154 <input type="button" name="javascriptButton" value="Javascript Button" onClick="
155 var npass = this.getField( \' password \' ).value;
156 app.alert( \' Value of password field is: \\\'\' + npass + \'\\\'\' );
157 var nButton = app.alert({
158 cMsg: \' Do you want to change the input text field to: T\u00f6rkylempij\u00e4? \' ,
159 cTitle: \' A message from A. C. Robat \' ,
162 if ( nButton == 4 ) {
163 this.getField( \' inputfield \' ).value = \' T\u00f6rkylempij\u00e4 \' ;
173 //==============================================================
174 if ( $_REQUEST [ 'html' ]) { echo $html
; exit ; }
175 if ( $_REQUEST [ 'source' ]) {
177 header ( "Content-Type: text/plain" );
178 header ( "Content-Length: " . filesize ( $file ));
179 header ( "Content-Disposition: attachment; filename='" . $file . "'" );
184 //==============================================================
185 $mpdf- > useActiveForms
= true ;
188 // Try playing around with these (these are also in config.php)
189 $mpdf->formUseZapD = false;
190 $mpdf->formSubmitNoValueFields = true;
192 $mpdf->formExportType = 'xfdf'; // 'html' or 'xfdf'
193 $mpdf->formSelectDefaultOption = true; // for Select drop down box; if no option is explicitly maked as selected,
194 // this determines whether to select 1st option (as per browser)
195 // - affects whether "required" attribute is relevant
196 $mpdf->form_border_color = '0.0 0.820 0.0';
197 $mpdf->form_background_color = '0.941 0.941 0.941';
198 $mpdf->form_border_width = '1';
199 $mpdf->form_border_style = 'S';
201 $mpdf->form_radio_color = '0.0 0.820 0.0';
202 $mpdf->form_radio_background_color = '0.941 0.5 0.5';
204 $mpdf->form_button_border_color = '0.0 0.820 0.0';
205 $mpdf->form_button_background_color = '0.941 0.941 0.941';
206 $mpdf->form_button_border_width = '1';
207 $mpdf->form_button_border_style = 'S';
210 $mpdf- > WriteHTML ( $html );
212 //==============================================================
213 // JAVASCRIPT FOR WHOLE DOCUMENT
215 var dialogTitle = "Enter details";
216 var defaultAnswer = "";
217 var reply = app.response("This is javascript set to run when the document opens. Enter value for first field", dialogTitle, defaultAnswer);
219 this.getField("inputfield").value = reply;
222 //==============================================================
224 $mpdf- > Output (); exit ;
227 //==============================================================
228 //==============================================================
229 //==============================================================
230 //==============================================================