Welcome Guest, Not a member yet? Register   Sign In
Using form helper? Is there a way to modify the DOM?
#1

(This post was last modified: 09-21-2020, 11:24 AM by richb201.)

I have a form that I created. It is called http://localhost/index.php/FormUserBackend. Near the top I want to append  some radio buttons. So I tried this:

form_open('views/User_Activity_Survey.php');
$str=form_checkbox( "test1", "Question1",FALSE, "class=form-checkbox id=input_4_3 name=q4_whichOf[]" );
echo ($str);
$str=form_checkbox( "test2", "Question2",FALSE, "class=form-checkbox id=input_4_3 name=q4_whichOf[]" );
echo ($str);
$str=form_checkbox( "test3", "Question3",FALSE, "class=form-checkbox id=input_4_3 name=q4_whichOf[]" );
echo ($str);
form_fieldset_close();
$this->load->view('User_Activity_Survey.php');


Bur when I look at the output in the browser, none of these appended fields display. So I decided to look in the output window and I do see them near the top:
X-Powered-By: PHP/7.2.32

Expires: Thu, 19 Nov 1981 08:52:00 GMT

Cache-Control: no-store, no-cache, must-revalidate

Pragma: no-cache

Set-Cookie: cisession=hbmpjleolom8fuaqdnri0ch1abf0b5cf; expires=Tue, 22-Sep-2020 01:42:18 GMT; Max-Age=28800; path=/; HttpOnly

Content-type: text/html; charset=UTF-8



<input type="checkbox" name="test1" value="Question1"  class=form-checkbox id=input_4_3 name=q4_whichOf[] />

<input type="checkbox" name="test2" value="Question2"  class=form-checkbox id=input_4_3 name=q4_whichOf[] />

<input type="checkbox" name="test3" value="Question3"  class=form-checkbox id=input_4_3 name=q4_whichOf[] />





<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<html lang="en-US"  class="supernova"><head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<link rel="alternate" type="application/json+oembed" href="https://www.jotform.com/oembed/?format=json&amp;url=https%3A%2F%2Fform.jotform.com%2F202597294899073" title="oEmbed Form">
<link rel="alternate" type="text/xml+oembed" href="https://www.jotform.com/oembed/?format=xml&a

etc.

They are in the wrong place. Is there some built in tools in CI to manipulate the DOM? This might be better than blindly prepending some checkboxes. 
proof that an old dog can learn new tricks
Reply


Messages In This Thread
Using form helper? Is there a way to modify the DOM? - by richb201 - 09-21-2020, 10:49 AM



Theme © iAndrew 2016 - Forum software by © MyBB