Using php in a value

All Quick 'n Easy Web Builder support issues that are not covered in the forums below.
Post Reply
greg_c_james
Posts: 2
Joined: Wed Sep 23, 2015 5:08 am

Using php in a value

Post by greg_c_james » Wed Sep 23, 2015 5:20 am

Hi
I would like to pre load text boxes using a php variable , for example

<input type="text" id="Driver" name="Driver_1" value="<?php echo $Driver ?>" >

But when I enter <?php echo $Driver ?> in the Property Inspector Value box it generates

<input type="text" id="Drive" name="Driver" value="<?php echo $Driver ?>" >

Is there any way of doing this ?

I have also tried using the Object HTML to add the value but it puts it at the end of the tag and the browser does not display it

<input type="text" id="Driver_1"name="Driver_1" value="<?php echo $Driver ?>" value="<?php echo $Driver_1 ?>" >

The last resort would be to use a JQuery script

Cheers

Greg

User avatar
Pablo
Site Admin
Posts: 2840
Joined: Mon Feb 13, 2006 7:00 am
Location: Europe
Contact:

Re: Using php in a value

Post by Pablo » Wed Sep 23, 2015 5:28 am

All input is encoded to make it valid text, so you cannot add HTML/PHP inside attributes.
But you can use a HTML object, to insert your own code.

greg_c_james
Posts: 2
Joined: Wed Sep 23, 2015 5:08 am

Re: Using php in a value

Post by greg_c_james » Thu Sep 24, 2015 1:01 am

I Tried using the HTML object but it would generate

<input type="text" id="Driver" name="Driver_1" value="" value="<?php echo $Driver ?>" >

The browser would not display the PHP value

User avatar
Pablo
Site Admin
Posts: 2840
Joined: Mon Feb 13, 2006 7:00 am
Location: Europe
Contact:

Re: Using php in a value

Post by Pablo » Thu Sep 24, 2015 6:33 am

Why not?
The code will be published "AS IS", so if you insert valid HTML/PHP then it should work.
If it doesn't work then either the code is invalid or incomplete.
For example don't forget to add styling.

User avatar
vic53
Posts: 20
Joined: Fri Feb 09, 2018 4:36 pm
Location: Fonte Nuova Italia

Re: Using php in a value

Post by vic53 » Sun Feb 11, 2018 10:48 am

I have the same problem,
The code is correct but the browser display only the first value...
in the generated code if you remove the ...value=""... then the generated code functions perfect...
but in the QBEWE the code is incorrect for programmers.
For Pablo....
There is a way to disable the generation of ...value="" in the propperty inspector field of form designer and the programmers man insert it manually in that object html ? for example adding a property in the form field inspector .... valuemanual yes or no

after generated code we must remove that code in order to have program tha run normally...

thanks and
"CIAO" by ITALIA
Vincenzo Manarolla

User avatar
Pablo
Site Admin
Posts: 2840
Joined: Mon Feb 13, 2006 7:00 am
Location: Europe
Contact:

Re: Using php in a value

Post by Pablo » Sun Feb 11, 2018 12:43 pm

I'm sorry the software was not designed to be used this way. It is not a code editor. There is no option to remove attributes.

User avatar
vic53
Posts: 20
Joined: Fri Feb 09, 2018 4:36 pm
Location: Fonte Nuova Italia

Re: Using php in a value

Post by vic53 » Sun Feb 11, 2018 5:25 pm

But If I want to send a value from the form1 to the form2 using submit, how I put the value in the form2 to display it ?

User avatar
Pablo
Site Admin
Posts: 2840
Joined: Mon Feb 13, 2006 7:00 am
Location: Europe
Contact:

Re: Using php in a value

Post by Pablo » Sun Feb 11, 2018 9:28 pm

Maybe this will work?

Code: Select all

document.getElementById("EditBox1").value = "<?php echo $variable; >?"; 
I will investigate if attribute encoding can be disabled for PHP code.

Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests