BullGuard Antivirus Sale - 60% Off with openElement !
Forum Home Forum Home >

openElement

> openElement General Discussion
  New Posts New Posts RSS Feed - Treat default input in form fields as script
  FAQ FAQ  Forum Search   Register Register  Login Login

Treat default input in form fields as script

 Post Reply Post Reply
Author
Message
frank_li View Drop Down
Newbie
Newbie


Joined: Mar 16 2018
Status: Offline
Points: 14
Post Options Post Options   Thanks (0) Thanks(0)   Quote frank_li Quote  Post ReplyReply Direct Link To This Post Topic: Treat default input in form fields as script
    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="&lt;?php echo $path; ?&gt;".

Any suggestions how I can fix that?Unhappy

Regards
Frank
Back to Top
Dmit OE View Drop Down
Admin Group
Admin Group


Joined: May 31 2012
Status: Offline
Points: 5283
Post Options Post Options   Thanks (0) Thanks(0)   Quote Dmit OE Quote  Post ReplyReply Direct Link To This Post Posted: Mar 21 2018 at 10:53am
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
Back to Top
frank_li View Drop Down
Newbie
Newbie


Joined: Mar 16 2018
Status: Offline
Points: 14
Post Options Post Options   Thanks (0) Thanks(0)   Quote frank_li Quote  Post ReplyReply Direct Link To This Post Posted: Mar 22 2018 at 8:20am
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
Back to Top
Dmit OE View Drop Down
Admin Group
Admin Group


Joined: May 31 2012
Status: Offline
Points: 5283
Post Options Post Options   Thanks (0) Thanks(0)   Quote Dmit OE Quote  Post ReplyReply Direct Link To This Post Posted: Mar 22 2018 at 10:03am
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

});
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.047 seconds.