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 7724485
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T04:42:04+00:00 2026-06-01T04:42:04+00:00

OK, this is perhaps stupidest question ever but bear with me…. How to make

  • 0

OK, this is perhaps stupidest question ever but bear with me….

How to make this work:

$("#basephoto").after(
  '<tr><td valign="bottom">Additional photo:</td>
       <td>&nbsp;&nbsp;&nbsp;</td>
       <td><div id="addphoto'+curupfld+'" class="browsebg">
         <p class="bpath"></p>
         <input onchange="fillBrowse(\"#addphoto'+curupfld+'\",this); validateExt(field);"  class="browse transfield" type="file" name="altphoto'+curupfld+'" size="40" />
         <span onclick="delImgField(this.id)" id="delbtn'+curupfld+'" class="abuttons delbtn"></span></div>
       </td>
   </tr>');

The part of interest:

onchange="fillBrowse(\"#addphoto'+curupfld+'\",this); validateExt(field);"

The problem starts at the “onchange”. I can always make a function that calls these two and the solution would be:

$("#basephoto").after(
  '<tr>
     <td valign="bottom">Additional photo:</td>
     <td>&nbsp;&nbsp;&nbsp;</td>
     <td>
       <div id="addphoto'+curupfld+'" class="browsebg">
       <p class="bpath"></p>
       <input onchange=functionCaller("#addphoto'+curupfld+'",this) class="browse transfield" type="file" name="altphoto'+curupfld+'" size="40" />
       <span onclick="delImgField(this.id)" id="delbtn'+curupfld+'" class="abuttons delbtn"></span>
       </div>
      </td>
   </tr>');

This works, but if possible I would like to solve the problem rather than just use a workaround method.

  • 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-01T04:42:05+00:00Added an answer on June 1, 2026 at 4:42 am

    I really don’t know what you are really doing. But if you just wan’t to write it in a more jQuery way.. This may help..

    $('#basephoto').append('<tr />');
    $('#basephoto tr').append(
        $('<td />')
            .attr('valign','bottom')
            .html('Additional photo:')
    );
    $('#basephoto tr').append(
        $('<td />')
            .html('&nbsp;&nbsp;&nbsp;')
    );
    $('#basephoto tr').append(
        $('<td />')
            .html(
                $('<div />')
                .attr({
                    "id":"addphoto-"+curupld,
                    "class":"browsebg"  
                })
                .html(
                    $('<p />')
                        .attr('class','bpath')
                        .html('')
                )
            )
    );
    $('#addphoto-'+curupfld).append(
        $('<input />')
            .attr({
                "class":"browse transfield",
                "type":"file",
                "name":"altphoto-"+curupfld,
                "size":"40"
            })
            .change(function(){
                functionCaller('#addphoto-'+curupfld,this);
                validateExt(field);
            })
    );
    $('#addphoto-'+curupfld).append(
        $('<span />')
            .attr({
                "class":"abuttons delbtn",
                "id":"delbtn-"+curupfld
            })
            .click(function(){
                delImgField($(this).attr('id'));
            })
    );
    

    Check out this post to know more how to create elements using jQuery:

    • http://mongsang-ga.tumblr.com/post/19914049827/how-to-create-a-element-in-jquery

    I guess you just need to add a line like this then to fix your
    problem:

    $('#input_that_has_the_change_event').change(function(){
        fillBrowse('#addphoto'+curupfld,this);
        validateExt(field);
    });
    

    *P.S.: Don’t say it’s stupid. I’m just like you before.. :]

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

Sidebar

Related Questions

This is perhaps more of a discussion question, but I thought stackoverflow could be
Perhaps this question has been asked elsewhere, but I'm unable to find it. With
I have an ObjectDataSource (but perhaps this question is the same for all kinds
This question has been asked before perhaps multiple times, but I can't get the
This is perhaps a painfully basic question to answer, but I'm wondering about performance
I realize this perhaps a naive question but still I cant figure out how
This is perhaps an obvious question, but I want to be sure. I'm trying
This is perhaps a silly question, but I can't seem to find out how
Perhaps this has something to do with it being the mainForm, but I'll ask
I'm new to visual studio, so perhaps this is something easy... but I've had

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.