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

  • SEARCH
  • Home
  • 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 8837869
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T09:50:19+00:00 2026-06-14T09:50:19+00:00

Hi I’m trying to get a dinamically input added with Jquery, but when I

  • 0

Hi I’m trying to get a dinamically input added with Jquery, but when I try to get the code it’s not working

The code in codeigniter catch all POST but less the one added by jquery

here is the code:

<script type="text/javascript">
 $(document).ready(function(){
    var value = parseFloat($("#subtotal").val());
    $('.subtotal').html(value);
    $('#subtotal').val(value);
    $('input[name="phprop"]').change(function(event){
        if($('input[name="phprop"]:checked').val() == 'Yes'){
            $('#sections').show();
        }else if($('input[name="phprop"]:checked').val() == 'No'){ $('#sections').hide();}
        });
        $('input[name="xsst"]').change(function(event){
        if($('input[name="xsst"]:checked').val() == 'Yes'){
            $('#xtraphotos').show();
            $('<input type="text"  name="extraid'+i+'" id="extraid'+ i +'" style="width:80px;margin-left:4px;"/>').appendTo('#xtrabox');
            var num = value + 9.95;
            value = parseFloat(num.toFixed(2));
            $('.subtotal').html(value);
            $('#subtotal').val(value);
            $('#extrass').val(i);               i++;

        }else if($('input[name="xsst"]:checked').val() == 'No'){ 
            $('#xtraphotos').hide();
            $('#xtraphotos input[type="text"]').remove();
            var num = value - 9.95 * (i - 1);
            value = parseFloat(num.toFixed(2));
            $('.subtotal').html(value);
            $('#subtotal').val(value);
            $('#extrass').val(0);
            i = 1;
            }
        });
        var scntDiv = $('#xtrabox');
        var i = 1;

    $('#addScnt').live('click', function() {
            $('<input type="text"  name="extraid'+i+'" id="extraid'+ i +'" style="width:80px;margin-left:4px;"/>').appendTo(scntDiv);
            num = value + 9.95;
            value = parseFloat(num.toFixed(2));
            $('.subtotal').html(value);
            $('#subtotal').val(value);
            $('#extrass').val(i);
            i++;                
            return false;
      });       
 });
 </script>

Here is the HTML

 <div style="margin-left: 50px;">
<label><b>Do you need more photos for your web?</b> </label>Yes<input type="radio"     name="xsst" id="xsst" value="Yes"/>No<input type="radio" name="xsst" id="xsst" value="No"/> (Each aditional photo has a cost of <b>$9.95</b>)
    <div id="xtraphotos" style="display:none;"><a href="#" id="addScnt">Add another picture box</a><div id="xtrabox"></div></div></div> 

Here is the Codeigniter code:

 if($_POST['extrass'] !=0){
        for($i=1;$i<=$_POST['extrass'];$i++){
            $names = "extraid".$i;
            $extras .= $_POST[$names];
            if($i!=$_POST['extrass']){
            $extras .= "-";
                }
        }

Here is the complete HTML (Just the form Section):

  <?php echo form_open_multipart(base_url() . 'purchase/confirmation')?>
    <p style="float:left">Image ID of the Photos for your Website</p><div style="float:left;margin: 13px 0 0 110px;width: 450px;"><?php 
   if($idtype == 4){$x=3;}elseif($idtype == 1){$x=5;}elseif($idtype == 2){$x=10;}elseif($idtype == 3){$x=13;}
    for($i=1;$i<=$x;$i++){?><input type="text"  name="ssid[]" id="ssid_<?=$i?>" value="" style="width:80px; margin-left:4px;"/><?php }?></div>
 </div>
  <div style="margin-left: 50px;">
  <label><b>Do you need more photos for your web?</b> </label>Yes<input type="radio"  name="xsst" id="xsst" value="Yes"/>No<input type="radio" name="xsst" id="xsst" value="No"/> (Each aditional photo has a cost of <b>$9.95</b>)
  <div id="xtraphotos" style="display:none;"><a href="#" id="addScnt">Add another picture box</a><div id="xtrabox"></div></div></div>


  <br />
    <div id="choose_your_template" style="background-image:url(<?=base_url()?>images/step_4.png)"><div style="padding-left:5px; float:left">
<span style=" position: relative; top: 14px; left: 210px; font-size: 18px; color: gray; ">Step 4: Do you have Photos? Upload the pictures for your website.</span></div>

    </div>
     <div style="margin-left: 50px;">
     <label>Do you have photos of your property? </label>Yes<input type="radio" name="phprop" id="phprop" value="Yes"/>No<input type="radio" name="phprop" id="phprop" value="No"/><br />
   <div id="sections" style="display:none;">
    <p>Upload the photos in the theme that they should be used. The photos should be in jpge.format. Otherwise the system will not accept. them.</p><br/>
   <?php 
    if($idtype == 4){$x=1;}elseif($idtype == 1){$x=3;}elseif($idtype == 2){$x=4;}elseif($idtype == 3){$x=5;}
   for($i=1;$i<=$x;$i++){?>
      <label>Section</label><select name="section[]" id="section"><option value="">Choose Section</option><option value="home">Home</option><option value="about-us">About Us</option><option value="contact-us">Contact Us</option></select><?php   for($j=1;$j<=4;$j++){?><input type="file"  name="userphoto<?=$i?><?=$j?>" /><?php }?><br />   <br />
  <?php }?>
     <p>I certify that the photos that i am uploading for the website development are of my entire property and that I have all the copyrights.</p></div>
   </div><br />

   <input type="hidden" id="domain" name="domain" value="<?=$domain?>" />
  <input type="hidden" id="payment_plan" name="payment_plan" value="<?=$poption?>" />
  <?php if($ownamedomain){?>
  <input type="hidden" name="ownamedomain" id="ownamedomain" value="<?=$ownamedomain?>" />
  <?php }?>
   <input type="hidden" name="idtype" id="idtype" value="<?=$idtype?>" />
  <input type="hidden" name="templateid" id="templateid" value="<?=$templateid?>" />
 <input type="hidden" name="extrass" id="extrass" value="0" />
 <input type="hidden" name="subtotal" id="subtotal" value="<?=$subtotal?>" />
 <div style="padding-left:45px; padding-top:15px;">
 <hr style=" width: 868px; margin: 0 0 16px; "/>
 <div align="center">
 <p>Subtotal: USD$<span class="subtotal"><?=$subtotal?></span> </p></div>
 </div>
 <div style="background:url(<?=base_url()?>images/bottombar.png) no-repeat;display: block;height: 16px;margin: 0 36px 10px;width: 902px;"></div>
 <input type="submit" name="continue" id="continue"/><input type="button" value="Back" onClick="history.back();" class="back">
  </div>
  • 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-06-14T09:50:21+00:00Added an answer on June 14, 2026 at 9:50 am

    Your HTML have a tag form?

    When.you not put forms elements inside a form, onload, some brownser add a form to correct code syntax… But when you add nes elements using DOM, maybe this elements not include inside this form…

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

Sidebar

Related Questions

I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I need to clean up various Word 'smart' characters in user input, including but
Let's say I'm outputting a post title and in our database, it's Hello Y&#8217;all
Basically, what I'm trying to create is a page of div tags, each has
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I am reading a book about Javascript and jQuery and using one of the
I am trying to render a haml file in a javascript response like so:

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.