Treat default input in form fields as script |
Post Reply |
Author | |
frank_li
Newbie Joined: Mar 16 2018 Status: Offline Points: 14 |
Post Options
Thanks(0)
Posted: Mar 20 2018 at 7:01pm |
Hi,
is there a way to treat the input value of a text input field and the label of the form button as script and not as HTML? I'm using php scripts to fill those fields like <?php echo $path; ?>, but they are translated to value="<?php echo $path; ?>". Any suggestions how I can fix that? Regards Frank |
|
Dmit OE
Admin Group Joined: May 31 2012 Status: Offline Points: 5283 |
Post Options
Thanks(0)
|
Hi,
Before doing this, could you please explain what you try to achieve? As it looks to me like a huge security hole, which even automated bots that crawl the Web constantly may abuse with very bad consequences |
|
frank_li
Newbie Joined: Mar 16 2018 Status: Offline Points: 14 |
Post Options
Thanks(0)
|
I use this to display and edit database entries, but only on pages that are restricted to admin access. The content is anyway checked and handled by php.
Since I couldn't wait for a openElement solution I did build the whole form now with php, but it would have been nicer to do it WYSYWIG. Thanks for reply Frank |
|
Dmit OE
Admin Group Joined: May 31 2012 Status: Offline Points: 5283 |
Post Options
Thanks(0)
|
I finally understood what you want.
0) Make sure your page is of type PHP (ex. index.php and not index.htm) 1) For each input element, add in Properties a unique Custom Class, ex. path 2) Add a Code Block (Source) type JavaScript position Header with the code $(function(){ // on page loaded $('.path input').val("<?php echo htmlentities($path) ?>"); // add this for each field & value }); |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |