Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4274574
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T07:51:56+00:00 2026-05-21T07:51:56+00:00

I have installed Modernizr into my code to enable html5 placeholder support in firefox

  • 0

I have installed Modernizr into my code to enable html5 placeholder support in firefox 3.6

My issue is that because I am using a template structure (M.V.C) as my code base, I am unsure how I can get the “if()” script to work for my particular page as it would have to be called in the view. I have moved my modernizr script into my haeder -> was in my footer

My Form:

 <?php
//Setting form attributes
$formAddSale = array('id' => 'addSale', 'name' => 'addSale');
$saleName = array('id' => 'name', 'name' => 'name', 'placeholder' => 'Name*');
$saleLocation = array('id' => 'location', 'name' => 'location', 'placeholder' => 'Location*');
$saleBedrooms = array('id' => 'bedrooms','name' => 'bedrooms', 'placeholder' => 'Number of Bedrooms*');
$saleBathrooms = array('id' => 'bathrooms','name' => 'bathrooms', 'placeholder' => 'Number of Bathrooms*');
$saleCondition = array('id' => 'condition','name' => 'condition', 'placeholder' => 'Condition*');
$saleImage = array('id' => 'userfile', 'name'=> 'userfile', 'placeholder' => 'File Location*');
$saleDescription = array('id' => 'description','name' => 'description', 'placeholder' => 'Sale Description*');
$salePrice = array('id' => 'price','name' => 'price', 'placeholder' => 'Price*');
?>

<section id = "validation"><?php echo validation_errors();?></section>
<?php 
echo form_open_multipart('admin/addsale/', $formAddSale);
echo form_fieldset(); 
echo form_input($saleName);
echo form_input($saleLocation);
echo form_input($saleBedrooms);
echo form_input($saleBathrooms);
echo form_input($saleCondition);
echo form_input($salePrice);
echo form_upload($saleImage);
echo form_textarea($saleDescription);
echo form_submit('submit','Submit');
echo form_fieldset_close();
echo form_close();
?>

At the time of writing this question I have created a ‘misc.js’ document with the following code:

    // if placeholder isn't supported:
if (!Modernizr.input.placeholder){
  // use a input hint script
    setInputHint(document.getElementById('name'),'Name*');
    setInputHint(document.getElementById('location'),'Location*');
    setInputHint(document.getElementById('bedrooms'),'Number of Bedrooms*');
    setInputHint(document.getElementById('bathrooms'),'Number of Bathrooms*');
    setInputHint(document.getElementById('condition'),'Condition*');
    setInputHint(document.getElementById('price'),'Price*');
    setInputHint(document.getElementById('description'),'Sale Description*');
    setInputHint(document.getElementById('userfile'),'File Location*');
   }

I have included the above document as you normally would in the footer of my “template”

<!-- jQuery Files --> 
<script type="text/javascript"    src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script> 
<script type="text/javascript" src="http://www.domain.co.nz/includes/js/placeholder.js"></script> 
<script type="text/javascript" src="http://www.domain.co.nz/includes/js/misc.js">    </script>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T07:51:57+00:00Added an answer on May 21, 2026 at 7:51 am

    Are you getting any Javascript errors ?

    Because you are using a JS library ( jQuery ) you can replace ‘document.getElementById’ with ‘$’ so save a lot of coding.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have installed WAMP and enable some extension. After that i have installed eclipse
I have installed an application that uses .net framework 3.5 after setup I can't
I have installed and setup RubyCAS-Server and RubyCAS-Client on my machine. Login works perfectly
I have installed CherryPy 3.1.0,. Here is what happens when I try to run
I have installed Delphi Prism and XNA Game Studio 3.0. I have managed to
I have installed Visual Studio 2008 and patch it with SP1. However, I cannot
I have installed Xperf performance analyzer from Windows SDK and captured a trace as
I have installed: Visual C# 2008 Express Visual Web Developer 2008 Express Visual Studio
I have installed pylons based application from egg, so it sits somewhere under /usr/lib/python2.5/site-packages.
I have IIS 5.1 installed on Windows XP Pro SP2. Besides I have installed

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.