Jump to content
phpsane

Why Code Shows-Up in Block-Text Box ?

Recommended Posts

Folks,

 

What is wrong with the block text with the label "Description" ?

All html after or below it in the file shows-up inside the block-text box when you check the page in the browser!

	<form name "link_submission_form" method = "post" action="" enctype = "multipart/form-data"> 
    <div class="form-group"> 
        <p align="left"><label>Url:</label> 
        <select> 
        <option value="<?php echo "$primary_domain";?>"><?php echo "$primary_domain";?></option>
        </select> 
        <input type="url" placeholder="<?php echo '/directory/page.html';?>" name="primary_website_url" required [A-Za-z0-9] autocorrect=off value="<?php if(isset($_POST['primary_website_url'])) { echo htmlentities($_POST['primary_website_url']); }?>">
        <label>; Anchor Text:</label> 
        <input type="text" placeholder="Enter Link Text" name="anchor_text" required [A-Za-z0-9] autocorrect=off value="<?php if(isset($_POST['anchor_text'])) { echo htmlentities($_POST['anchor_text']); }?>">
        </p> 
    </div> 
    <div class="form-group"> 
        <p align="left"><label>Page Title:</label> 
        <input type="text" placeholder="Enter Page Title" name="page_title" required [A-Za-z0-9] autocorrect=off value="<?php if(isset($_POST['page_title'])) { echo htmlentities($_POST['page_title']); }?>"> 
        </p>     
    </div> 
    <div class="form-group">     
        <p align="left"><label>Page Description:</label> 
        <textarea rows="10" cols="100" placeholder="Page Description" name="page description" required [A-Za-z0-9] autocorrect=off value="<?php if(isset($_POST['page_description'])) { echo htmlentities($_POST['page_description']); }?>"> 
        </p> 
    </div>     
    <div class="form-group"> 
        <p align="left"><label>Primary Website Email (To receive Visitor Entry Alerts):</label> 
        <input type="text" placeholder="Email to receive Visitor Entry Notice" name="primary_website_email_for_visitor_entry_notice" required [A-Za-z0-9] autocorrect=off value="<?php if(isset($_POST['primary_website_email_for_visitor_entry_notice'])) { echo htmlentities($_POST['primary_website_email_for_visitor_entry_notice']); }?>">
        </p> 
    </div> 
    <div class="form-group"> 
        <p align="left"><label>Repeat Primary Website Email (To receive Visitor Entry Alerts):</label> 
        <input type="text" placeholder="Repeat Email to receive Visitor Entry Notice" name="primary_website_email_confirmation_for_visitor_entry_notice" required [A-Za-z0-9] autocorrect=off value="<?php if(isset($_POST['primary_website_email_confirmation_for_visitor_entry_notice'])) { echo htmlentities($_POST['primary_website_email_confirmation_for_visitor_entry_notice']); }?>">
        </p> 
    </div> 
    <div class="form-group"> 
        <p align="left"><label>Primary Website Email (To receive Visitor Exit Alerts):</label> 
        <input type="text" placeholder="Email to receive Visitor Exit notice" name="primary_website_email_for_visitor_exit_notice" required [A-Za-z0-9] autocorrect=off value="<?php if(isset($_POST['primary_website_email_for_visitor_exit_notice'])) { echo htmlentities($_POST['primary_website_email_for_visitor_exit_notice']); }?>">
        </p> 
    </div> 
    <div class="form-group"> 
        <p align="left"><label>Repeat Primary Website Email (To receive Visitor Exit Alerts):</label> 
        <input type="text" placeholder="Repeat Email to receive Visitor Exit notice" name="primary_website_email_confirmation_for_visitor_exit_notice" required [A-Za-z0-9] autocorrect=off value="<?php if(isset($_POST['primary_website_email_confirmation_for_visitor_exit_notice'])) { echo htmlentities($_POST['primary_website_email_confirmation_for_visitor_exit_notice']); }?>">
        </p> 
    </div>     
    <div class="form-group"> 
        <p align="left"><label>Agree To Our Terms & Conditions ? :</label> 
        <input type="radio" name="fb_tos_agreement_reply" value="Yes" <?php if(isset($_POST['fb_tos_agreement_reply'])) { echo 'checked'; }?> required>Yes  
        <input type="radio" name="fb_tos_agreement_reply" value="No" <?php if(isset($_POST['fb_tos_agreement_reply'])) { echo 'checked'; }?> required>No
        </p>  
    </div> 
<p align="left"><input type="submit" class="btn btn-default" name="submit" value="Submit"></p> 
<p align="left"><input type="reset" class="btn btn-default" name="reset" value="Reset"></p>     
</form> 
	

Notice each input field's requirement. Have I got any wrong ? Example:

	<input type="text" placeholder="Enter Link Text" name="anchor_text" required [A-Za-z0-9] autocorrect=off value="<?php if(isset($_POST['anchor_text'])) { echo htmlentities($_POST['anchor_text']); }?>">
	

Share this post


Link to post
Share on other sites

Text areas do not have a value attribute. EG

<textarea rows="10" cols="100" name="page_description" >Text area content goes here</textarea>

The text content goes between the <textarea> and </textarea> tags.

As you don't have the closing </textarea> it assumes everything following is still part of the text content.

Edited by Barand
  • Like 1
  • Great Answer 1

Share this post


Link to post
Share on other sites
35 minutes ago, Barand said:

Text areas do not have a value attribute. EG


<textarea rows="10" cols="100" name="page_description" >Text area content goes here</textarea>

The text content goes between the <textarea> and </textarea> tags.

As you don't have the closing </textarea> it assumes everything following is still part of the text content.

Oops! Thanks!

I need blocktext box input to remain should user get php echoing error due to any incorrect inputs in any fields of the form.

And so, I coded it like this now:

	<div class="form-group">     
        <p align="left"><label>Page Description:</label> 
        <textarea rows="10" cols="100" name="page description" required [A-Za-z0-9] autocorrect=off><?php if(isset($_POST['page_description'])) { echo htmlentities($_POST['page_description']); }?> </textarea> 
        </p> 
    </div> 
	

What do you think now ? Any good ?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.