www.webdeveloper.com
Recent Articles
  • Finding Slow Running Queries in ASE 15
  • A More Advanced Pie Chart for Analysis Services Data
  • Adobe AIR Programming Unleashed: Working with Windows
  • Performance Testing SQL Server 2008's Change Data Capture Functionality
  • The ABC's of PHP: Introduction to PHP
  • How to Migrate from BasicFiles to SecureFiles Storage
  • Why the Twitter Haters Are Wrong
  • User Personalization with PHP: Beginning the Application
  • Whats in an Oracle Schema?
  • Lighting Enhancement in Photoshop
  •  

    Go Back   WebDeveloper.com > Client-Side Development > HTML

    HTML Discussion and technical support for building, using and deploying HTML sites.

    Reply
     
    Thread Tools Rate Thread Display Modes
      #1  
    Old 03-09-2010, 07:51 PM
    learningformyse learningformyse is offline
    Registered User
     
    Join Date: Mar 2010
    Posts: 4
    Question Please help me fix this code

    Hi Everyone,

    I have been trying to fix this code so that it grabs the first image selected the front and side graphics and the text typed and renders it below as one graphic.
    <head >
    <title>E-Cover</title>

    <script type='text/javascript'>

    function a(){
    var iframe = document.getElementById('image.jpg');
    alert(iframe.contentWindow.document.body.innerHTML );
    }

    </script><script>
    function temp(str){
    var ifr=document.getElementById("itemplate");
    if (str)
    ifr.src="templates/"+str;
    else ifr.src="notemplate.htm";
    }
    function temp2(str){
    var ifr=document.getElementById("itemplate2");
    if (str)
    ifr.src="fronts/"+str;
    else ifr.src="none.jpg";
    }
    function temp3(str){
    var ifr=document.getElementById("itemplate3");
    if (str)
    ifr.src="sides/"+str;
    else ifr.src="none.jpg";
    }
    </script>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head>
    <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" bgcolor="#3399FF">
    <form action="ecover.php" method="post" id="" target="iecover" enctype="multipart/form-data">
    <table height="100%" width="700" class="table10" align=center>

    <table width="490" align="center" cellpadding="2" cellspacing="2">
    <tr align="center">
    <td colspan="2" class=head1><b><font size="4" face="Georgia">Make your E-Cover</font></b></td>
    </tr>
    <tr>
    <td height=10 width=150><img src=#none height=1 width=150></td>

    <td ></td>
    </tr>
    <TR >
    <TD align=left width=100>
    <select size="18" name=template onchange="temp(this.value);">
    <option selected value=''><--Choose a template--></option>
    <option value='ecover01.jpg'>ecover01</option>
    <option value='ecover13.jpg'>ecover13</option>
    <option value='ecover09.jpg'>ecover09</option>


    </select>

    </TD>
    <TD width="100%" align="left"><iframe src="notemplate.htm" id="itemplate" frameborder=0></iframe></TD>
    </TR>
    <tr>
    <td colspan="2" height=10 valign=center align=center class=padding0><img src=#none class=hr></td>
    </tr>
    <TR>
    <TD align=left valign="top" class=tp colspan="2">
    <p align="center"><b><font color="#000080" size="5">Create a
    headline to put on your ecover.&nbsp; Select a headline text, font
    and colour.&nbsp; </font></b></p>

    <p align="center"><font color="#000080"><b>
    <span style="background-color: #FFFF00">NOTE</span>:&nbsp; For best
    quality we recommend creating an front cover image with your
    favorite graphic program, and insert your text in that graphic.&nbsp;Recommended
    sizes (in pixels) are: Front cover.. 350w x 400h Spine.. 100w x 400h</b></font></TD>
    </TR>
    <TR>
    <TD align=left valign="top" class=tp>Headline Text:</TD>
    <TD align="left">
    <INPUT name=headline maxlength="35" size="25">

    </TD>
    </TR>
    <TR >
    <TD align=left valign="top" class=tp>Headline Text Font:</TD>
    <TD align="left">
    <select name=textformat>
    <option value='ARIAL_BOLD.TTF'>ARIAL_BOLD.TTF</option>
    <option value='TIMES_BOLD.TTF'>TIMES_BOLD.TTF</option>
    <option value='COURIER_BOLD.TTF'>COURIER_BOLD.TTF</option>

    </select>
    </TD>
    </TR>
    <!-- <TR>
    <TD align=left>Headline Text Color:</TD>
    <TD align="left">
    <INPUT name=headlinecolor style="width: 150px;">
    (e.g. #00FF3d ) </TD>
    </TR>-->
    <!-- <tr><td height=7></td></tr>-->
    <TR >
    <TD align=left valign="top" class=tp>Headline Text Colour:</TD>
    <TD align="left">
    <select name=headlinecolor>

    <option value="0,0,0">Black</option>
    <option value="0,0,255">Blue</option>
    <option value="0,255,0">Green</option>
    </select>
    <br>
    <br>
    </TD>
    </TR>
    <TR >
    <TD align=left valign="top" class=tp colspan="2">

    <p align="center"><b><font color="#000080" size="5">Create a
    headline to put on the spine.&nbsp; Select a headline text, font
    and colour.&nbsp; </font></b></p>
    <p align="center"><font color="#000080"><b>
    <span style="background-color: #FFFF00">NOTE</span>:&nbsp; Because
    of size limitations, some templates don't have a spine.&nbsp;
    </b></font></TD>
    </TR>

    <TR >
    <TD align=left valign="top" class=tp>Spine Text:</TD>
    <TD align="left">
    <INPUT name=subheadline size="20">
    </TD>
    </TR>
    <TR >
    <TD align=left valign="top" class=tp>Spine Text Font:</TD>
    <TD align="left">
    <select name=subtextformat>

    <option value='ARIAL_BOLD.TTF'>ARIAL_BOLD.TTF</option>
    <option value='TIMES_BOLD.TTF'>TIMES_BOLD.TTF</option>
    <option value='COURIER_BOLD.TTF'>COURIER_BOLD.TTF</option>
    </select>
    </TD>
    </TR>
    <!-- <TR>
    <TD align=left>Sub Headline Text Color:</TD>
    <TD align="left" style="width: 150px;">
    <INPUT name=subheadlinecolor>
    </TD>
    </TR>-->
    <!-- <tr><td height=7></td></tr>-->

    <TR >
    <TD align=left valign="top" class=tp>Spine Text Colour:</TD>
    <TD align="left">
    <select name="subcolor">
    <option value="0,0,0">Black</option>

    </select>
    <br>
    <br>

    </TD>
    </TR>
    <TR >
    <TD align=left valign="top" class=tp colspan="2">
    <p align="center"><font size="4" color="#000080"><b>Select your
    pre-designed graphic to put as the front image on your cover, or use
    one of our graphics.</b></font></TD>
    </TR>
    <TR >
    <TD align=left valign="top" class=tp>Front Cover Image:</TD>
    <TD align="left">
    <INPUT type=file name=frontcover size="20">

    to upload your own<br>
    &nbsp;&nbsp;or <br>
    <table height="85" border="0" cellpadding="0" cellspacing="0" class=table0>
    <tr>
    <td align="left" style="padding: 0px;">
    <select size="8" name=frontcover2 onchange="temp2(this.value);">
    <option selected value=''><--Choose a front--></option>
    <option value='purpleguy.jpg'>purpleguy</option>


    </select>

    </td>
    <td> <img src="none.jpg" id="itemplate2" class=iframe2 frameborder=0>
    </td>
    </tr>
    </table>
    </TD>
    </TR>
    <TR >
    <TD align=left valign="top" class=tp colspan="2">

    <p align="center"><font size="4" color="#000080"><b>Select your
    pre-designed graphic to put as the side image on your cover, or use
    one of our graphics.</b></font></TD>
    </TR>
    <TR >
    <TD align=left valign="top" class=tp>Spine Image:<br>
    (Optional)</TD>
    <TD align="left">
    <INPUT type=file name=spine size="20">
    to upload your own<br>

    &nbsp;&nbsp;or <br>
    <table class=table0 cellpadding="0" cellspacing="0">
    <tr>
    <td style="padding:0px;">
    <select size="8" name=spine2 onChange="temp3(this.value);">
    <option selected value=''><--Choose a spine--></option>
    <option value='s_barcode_spine_red.jpg'>s_barcode_spine_red</option>
    <option value='s_barcode_spine_balck.jpg'>s_barcode_spine_balck</option>
    <option value='s_barcode_spine_orange.jpg'>s_barcode_spine_orange</option>

    </select>
    </td>
    <td>

    <img src=none.jpg id="itemplate3" class=iframe2 frameborder=0>
    </td>
    </tr>
    </table>
    </TD>
    </TR>

    <tr>
    <td colspan="2" height=10 valign=top align=center class=padding0><img src=#none class=hr></td>
    </tr>
    <tr>
    <td colspan="2" height=10></td>
    </tr>
    <tr align="right">
    <td colspan="2"> <iframe id ='itemplate' src='ecover.php'></iframe>

    <button onclick='a()'>get</button>




    </td>
    </tr>

    </table>
    Reply With Quote
      #2  
    Old 03-10-2010, 06:47 AM
    Fang's Avatar
    Fang Fang is offline
    Resistance is futile
     
    Join Date: Apr 2003
    Location: Netherlands
    Posts: 20,471
    Add the name attribute to the iframe, then reference
    Code:
    itemplate.location = "templates/"+str;
    As for changing the font, first read this: http://randsco.com/index.php/2009/07/04/p680
    __________________
    At least 98% of internet users' DNA is identical to that of chimpanzees
    Reply With Quote
      #3  
    Old 03-10-2010, 08:10 AM
    learningformyse learningformyse is offline
    Registered User
     
    Join Date: Mar 2010
    Posts: 4
    Hi

    Hi Fang,

    Ok I tried what you suggested but where it is supposed to render to ecover.php all it is doing is grabbing the page and not rendering the string

    what am I doing wrong?

    -Will
    Reply With Quote
      #4  
    Old 03-10-2010, 08:21 AM
    Fang's Avatar
    Fang Fang is offline
    Resistance is futile
     
    Join Date: Apr 2003
    Location: Netherlands
    Posts: 20,471
    Your code picks an image and displays it in the iframe. What has ecover.php to do with this?
    __________________
    At least 98% of internet users' DNA is identical to that of chimpanzees
    Reply With Quote
      #5  
    Old 03-10-2010, 08:35 AM
    learningformyse learningformyse is offline
    Registered User
     
    Join Date: Mar 2010
    Posts: 4
    Hi,

    I am just learning I thought that when calling the post you had to have a document to display the rendered image.

    <form action="ecover.php" method="post" id="form1" target="iecover">

    Are you saying I don't need this reference I am sorry I am confused this is my first try I appreciate your help
    -Will
    Reply With Quote
      #6  
    Old 03-10-2010, 12:05 PM
    Fang's Avatar
    Fang Fang is offline
    Resistance is futile
     
    Join Date: Apr 2003
    Location: Netherlands
    Posts: 20,471
    You can do it with a form an iframe or even add the image to the document.
    __________________
    At least 98% of internet users' DNA is identical to that of chimpanzees
    Reply With Quote
    Reply

    Bookmarks


    Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
     
    Thread Tools
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is Off
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 11:38 AM.



    Acceptable Use Policy

    Internet.com
    The Network for Technology Professionals

    Search:

    About Internet.com

    Legal Notices, Licensing, Permissions, Privacy Policy.
    Advertise | Newsletters | E-mail Offers

    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.