Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 11 of 11
  1. #1
    New Coder
    Join Date
    May 2004
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Looking for assistance in building dynamic forms

    Hello:

    My business is dye-sublimation printing, not becoming fluent with JS.
    Do I have the capacity to learn JS? Yes. (I am an old DOS basic user from years back)
    Do I have the time to learn what I need to know to complete this objective, No.
    I am looking for a freelance JS programmer that would be open for hire, (barter or $$. Reasonable, I am not rich). I can follow and modify by example with JS but that is the extent of my knowledge.

    Now you know my objectives, you can decide whether to read on or not.

    Here is my basic form with comments inserted showing what needs to happen and where.

    Code:
    <form method="POST" action="%%script_loc%%">
          <input type="hidden" name="user_action" value="addtocart">
    	<input type="hidden" name="catalogno" value="%%catalogno%%">
    	<input type="hidden" name="multi" value="multi">
    	<input type="hidden" name="add%%catalogno%%" value="YES">
        <font face="Arial"></font>    <table width="100%" border="0" cellspacing="0" cellpadding="5">
          <tr>
            <td colspan="2">Check the boxes next to the sizes then enter the quantity
              for each size checked</td>
          </tr>
          <tr>
            <td><div align="center"><strong>Size
              <!--The size checkbox names and the quantity textbox names can be anything. They are for user input to be manipulated and inserted to specific named fields. -->
            </strong></div>
            </td>
            <td><div align="center"><strong>Quantity</strong></div>
            </td>
          </tr>
          <tr>
            <td><input name="small" type=CHECKBOX id="small" value="Small">      
              Small</td>
            <td><div align="center">
                <input name="s" type=TEXT id="s" size=3 maxlength=2>
                <small><font face="Arial">
                </font></small> </div>
            </td>
          </tr>
          <tr>
            <td><input name="medium" type=CHECKBOX id="Medium" value="Medium">      
              Medium</td>
            <td><div align="center">
                <INPUT NAME="m" TYPE=TEXT id="m" SIZE=3 MAXLENGTH=2>
                <small><font face="Arial">
                </font></small> </div>
            </td>
          </tr>
          <tr>
            <td><input name="large" type=CHECKBOX id="large" value="large">
          Large</td>
            <td><div align="center">
                <INPUT NAME="l" TYPE=TEXT id="l" SIZE=3 MAXLENGTH=2>
                <small><font face="Arial">
                </font></small> </div>
            </td>
          </tr>
          <tr>
            <td><INPUT NAME="xlarge" TYPE=CHECKBOX id="xlarge" VALUE="XLarge">
          XLarge</td>
            <td><div align="center">            
              <input name="xl" type=TEXT id="xl" size=3 maxlength=2>
              <small><font face="Arial">
                </font></small> </div>
            </td>
          </tr>
          <tr>
            <td nowrap><INPUT NAME="xxlarge" TYPE=CHECKBOX id="xxlarge" VALUE="XXLarge">
          XX Large</td>
            <td><div align="center">
                <div align="center">
                  <INPUT NAME="xxl" TYPE=TEXT id="xxl" SIZE=3 MAXLENGTH=2>
                  <small><font face="Arial">
                  </font></small> </div>
              </div>
            </td>
            <td><div align="center"> </div>
            </td>
          </tr>
          <tr>
            <td nowrap><INPUT NAME="xxxlarge" TYPE=CHECKBOX id="xxxlarge" VALUE="XXXLarge">
          XXX Large</td>
            <td><div align="center">
                <div align="center">
                  <INPUT NAME="xxxl" TYPE=TEXT id="xxxl" SIZE=3 MAXLENGTH=2>
                  <small><font face="Arial">
                  </font></small> </div>
              </div>
            </td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td nowrap>Total </td>
            <td><div align="center">
              <!--Must be named quantity. Must be a read only field.  This field needs to dynamiclly add the contents of field s through xxxl.-->
              <input name="quantity" type="text" id="quantity" size="4">
            </div></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td colspan="2" nowrap><!--Text area below must be named toption1. I want to dynamically compose a text list in this textbox based on user selection.
    Example:
    3   Small
    4   Medium
    25  Large
    10  XXLarge
    Formatting the assembled text in a list style is important. -->          <textarea name="toption1" cols="40" wrap="VIRTUAL" id="toption1"></textarea></td>
            <td>&nbsp;</td>
          </tr>
        </table>
        <div align="center"><center><table border="0"
          cellpadding="5" cellspacing="0" width="100%">
            <tr>
              <td><p><font face="Arial">            
                <!--All field names below must retain their names and duplicate names.  -->
                <input name="addfirst" type="hidden" id="addfirst" value="YES">
                <input name="quantity" type="hidden" id="quantity" value="copy from total quantity above">
                <input type="hidden" name="catalogno" value="first">
                <br>
              </font>Add second print?
                  <input
        name="addsecond" type="checkbox" id="addsecond" value="YES">
                  <font face="Arial">
                  <input name="quantity" type="hidden" id="quantity3" value="copy from total quantity above">
                  </font>
                  <input type="hidden" name="catalogno" value="second">
                  <br>
                  Add third print?
                  <input
        name="addsthird" type="checkbox" id="addsthird" value="YES">
                  <font face="Arial">
                  <input name="quantity" type="hidden" id="quantity4" value="copy from total quantity above">
                  </font>
                  <input name="catalogno" type="hidden" id="catalogno" value="third">
                  <br>
                  Add forth print?
                  <input
        name="addforth" type="checkbox" id="addforth" value="YES">
                  <font face="Arial">
                  <input name="quantity" type="hidden" id="quantity5" value="copy from total quantity above">
                  </font>
                  <input name="catalogno" type="hidden" id="catalogno" value="forth">
    </p>
                </td>
            </tr></table>
          </center></div>
        </form>
    I am open to negotiate compensation.

    Nelson Quimby / Elso Graphics
    http://www.elsographics.com
    Last edited by elso; 05-31-2004 at 01:24 AM.

  • #2
    Senior Coder
    Join Date
    Aug 2002
    Location
    Kansas City, Kansas
    Posts
    1,518
    Thanks
    0
    Thanked 2 Times in 2 Posts
    Try editing your post and putting all of that code in the [code] tags, it will increase the readability.

    I mean no offense when I say this, but your website needs quite a bit of work. I was looking at the site and it looks like you have some great products to sell. One of the best things about a business is not only their products, but also the way in which you come to look at them. Check out some of the other companies' websites that are in the same field as yourself. Some examples: [http://www.cafepress.com/cp/info/] , [http://www.zazzle.com/] , [http://www.designashirt.com./]. I do realize that you are not some huge corporation, but I believe that a great website could bring in tremendous business.

  • #3
    New Coder
    Join Date
    May 2004
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you and I take no offence. I am only one person. I am solely responsible for my site design as well as 100% of product production. I work out my attic apartment, so I depend solely on the Internet to generate sales. I have been printing ceramics since 1997 and just this year, I have broadened my product line adding in several new items. I also work a full time job and have zero formal training in any phase of business or presentation. I realize my site needs work, which is the reason I am here I am working with a new shopping cart/ presentation system which will be much better presentation once I can find someone to help me with my current objective to handle t-shirt variables. For a site that needs work, I do very well with sales (but they could be better). Not enough to quit my job yet. I hope I can find someone willing to assist me, so I can bring my new system live and improve my presentation.

  • #4
    Senior Coder
    Join Date
    Aug 2002
    Location
    Kansas City, Kansas
    Posts
    1,518
    Thanks
    0
    Thanked 2 Times in 2 Posts
    I'm not much of a server-side person, but I would be happy to help you out with any sort of html/css issues. You've come to the right place, there are plenty of people here to help you with whatever you need.

  • #5
    Regular Coder
    Join Date
    Jul 2002
    Posts
    698
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I made this little thing should do what you want.
    Code:
     
    <head>
    <script>
      function change()
    	{
    	  var topoption=document.getElementById('toption1');
    		
    		topoption.value='';
    		var tempArr=new Array();
    
    		if(document.getElementById('small').checked)
    		tempArr[tempArr.length]=new Array((parseInt(document.getElementById('s').value,10)==document.getElementById('s').value)?document.getElementById('s').value:0,'Small');
    		
    		if(document.getElementById('medium').checked)
    		tempArr[tempArr.length]=new Array((parseInt(document.getElementById('m').value,10)==document.getElementById('m').value)?document.getElementById('m').value:0,'Medium');
    
    		if(document.getElementById('large').checked)
    		tempArr[tempArr.length]=new Array((parseInt(document.getElementById('l').value,10)==document.getElementById('l').value)?document.getElementById('l').value:0,'Large');
    
    		if(document.getElementById('xlarge').checked)
    		tempArr[tempArr.length]=new Array((parseInt(document.getElementById('xl').value,10)==document.getElementById('xl').value)?document.getElementById('xl').value:0,'XLarge');
    
    		if(document.getElementById('xxlarge').checked)
    		tempArr[tempArr.length]=new Array((parseInt(document.getElementById('xxl').value,10)==document.getElementById('xxl').value)?document.getElementById('xxl').value:0,'XXLarge');
    
    		if(document.getElementById('xxxlarge').checked)
    		tempArr[tempArr.length]=new Array((parseInt(document.getElementById('xxxl').value,10)==document.getElementById('xxxl').value)?document.getElementById('xxxl').value:0,'XXXLarge');
        l=0;
    		for(i=0;i<tempArr.length;i++)
    		{
    		  if((tempArr[i][0]+'').length>l)l=(tempArr[i][0]+'').length;
    		}		
    		d=2;
    		spaces=new Array('',' ','  ','   ','    ','    '); 
    		var total=0;
    		for(i=0;i<tempArr.length;i++)
    		{
    		  topoption.value+=tempArr[i][0]+spaces[d+l-(tempArr[i][0]+'').length]+tempArr[i][1]+'\n\r';
    			total+=parseInt(tempArr[i][0],10);
    		}	
    		document.getElementById('quantity').value=total;
    	}
    </script>
    </head>
    
    <form method="POST" action="%%script_loc%%">
      <input type="hidden" name="user_action" value="addtocart">
    	<input type="hidden" name="catalogno" value="%%catalogno%%">
    	<input type="hidden" name="multi" value="multi">
    	<input type="hidden" name="add%%catalogno%%" value="YES">
        <font face="Arial"></font>    <table width="100%" border="0" cellspacing="0" cellpadding="5">
          <tr>
            <td colspan="2">Check the boxxes nexxt to the sizes then enter the quantity
              for each size checked</td>
          </tr>
          <tr>
            <td><div align="center"><strong>Size
              <!--The size checkboxx names and the quantity texxtboxx names can be anything. They are for user input to be manipulated and inserted to specific named fields. -->
            </strong></div>
            </td>
            <td><div align="center"><strong>Quantity</strong></div>
            </td>
          </tr>
          <tr>
            <td><input name="small" type=CHECKBOX id="small" value="Small" onclick="change();">      
              Small</td>
            <td><div align="center">
                <input name="s" type=TExxT id="s" size=3 maxxlength=2 onchange="change();">
                <small><font face="Arial">
                </font></small> </div>
            </td>
          </tr>
          <tr>
            <td><input name="medium" type=CHECKBOX id="medium" value="Medium"  onclick="change();">      
              Medium</td>
            <td><div align="center">
                <INPUT NAME="m" TYPE=TExxT id="m" SIZE=3 MAxxLENGTH=2 onchange="change();">
                <small><font face="Arial">
                </font></small> </div>
            </td>
          </tr>
          <tr>
            <td><input name="large" type=CHECKBOX id="large" value="large"  onclick="change();">
          Large</td>
            <td><div align="center">
                <INPUT NAME="l" TYPE=TExxT id="l" SIZE=3 MAxxLENGTH=2 onchange="change();">
                <small><font face="Arial">
                </font></small> </div>
            </td>
          </tr>
          <tr>
            <td><INPUT NAME="xlarge" TYPE=CHECKBOX id="xlarge" VALUE="xLarge"  onclick="change();">
          xLarge</td>
            <td><div align="center">            
              <input name="xl" type=TExxT id="xl" size=3 maxxlength=2 onchange="change();">
              <small><font face="Arial">
                </font></small> </div>
            </td>
          </tr>
          <tr>
            <td nowrap><INPUT NAME="xxlarge" TYPE=CHECKBOX id="xxlarge" VALUE="xxLarge"  onclick="change();">
          xx Large</td>
            <td><div align="center">
                <div align="center">
                  <INPUT NAME="xxl" TYPE=TExxT id="xxl" SIZE=3 MAxxLENGTH=2 onchange="change();">
                  <small><font face="Arial">
                  </font></small> </div>
              </div>
            </td>
            <td><div align="center"> </div>
            </td>
          </tr>
          <tr>
            <td nowrap><INPUT NAME="xxxlarge" TYPE=CHECKBOX id="xxxlarge" VALUE="xxxLarge"  onclick="change();">
          xxx Large</td>
            <td><div align="center">
                <div align="center">
                  <INPUT NAME="xxxl" TYPE=TExxT id="xxxl" SIZE=3 MAxxLENGTH=2 onchange="change();">
                  <small><font face="Arial">
                  </font></small> </div>
              </div>
            </td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td nowrap>Total </td>
            <td><div align="center">
              <!--Must be named quantity. Must be a read only field.  This field needs to dynamiclly add the contents of field s through xxxxxxl.-->
              <input name="quantity" type="text" id="quantity" size="4" readonly="">
            </div></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td colspan="2" nowrap><!--Texxt area below must be named toption1. I want to dynamically compose a texxt list in this texxtboxx based on user selection.
    Exxample:
    3   Small
    4   Medium
    25  Large
    10  xxxxLarge
    Formatting the assembled texxt in a list style is important. -->  
     <textarea name="toption1" cols="40" wrap="VIRTUAL" id="toption1"></textarea></td>
            <td>&nbsp;</td>
          </tr>
        </table>
        <div align="center"><center><table border="0"
          cellpadding="5" cellspacing="0" width="100%">
            <tr>
              <td><p><font face="Arial">            
                <!--All field names below must retain their names and duplicate names.  -->
                <input name="addfirst" type="hidden" id="addfirst" value="YES">
                <input name="quantity" type="hidden" id="quantity" value="copy from total quantity above">
                <input type="hidden" name="catalogno" value="first">
                <br>
              </font>Add second print?
                  <input
        name="addsecond" type="checkbox" id="addsecond" value="YES">
                  <font face="Arial">
                  <input name="quantity" type="hidden" id="quantity3" value="copy from total quantity above">
                  </font>
                  <input type="hidden" name="catalogno" value="second">
                  <br>
                  Add third print?
                  <input
        name="addsthird" type="checkbox" id="addsthird" value="YES">
                  <font face="Arial">
                  <input name="quantity" type="hidden" id="quantity4" value="copy from total quantity above">
                  </font>
                  <input name="catalogno" type="hidden" id="catalogno" value="third">
                  <br>
                  Add forth print?
                  <input
        name="addforth" type="checkbox" id="addforth" value="YES">
                  <font face="Arial">
                  <input name="quantity" type="hidden" id="quantity5" value="copy from total quantity above">
                  </font>
                  <input name="catalogno" type="hidden" id="catalogno" value="forth">
    </p>
                </td>
            </tr></table>
          </center></div>
        </form>

  • #6
    New Coder
    Join Date
    May 2004
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up

    Garadon

    Thank you so much, this is perfect and about maybe 75% or more of my objective. How much of a job would it be to carry the total over to additional hidden fields? (e.g. copy from total quantity above)

    Code:
     <input name="addfirst" type="hidden" id="addfirst" value="YES">
                <input name="quantity" type="hidden" id="quantity" value="copy from total quantity above">
                <input type="hidden" name="catalogno2" value="first">
                <br>
              </font>Add second print?
                  <input
        name="addsecond" type="checkbox" id="addsecond" value="YES">
                  <font face="Arial">
                  <input name="quantity" type="hidden" id="quantity3" value="copy from total quantity above">
                  </font>
                  <input type="hidden" name="catalogno" value="second">
                  <br>
                  Add third print?
                  <input
        name="addsthird" type="checkbox" id="addsthird" value="YES">
                  <font face="Arial">
                  <input name="quantity" type="hidden" id="quantity4" value="copy from total quantity above">
                  </font>
                  <input name="catalogno" type="hidden" id="catalogno" value="third">
                  <br>
                  Add forth print?
                  <input
        name="addforth" type="checkbox" id="addforth" value="YES">
                  <font face="Arial">
                  <input name="quantity" type="hidden" id="quantity5" value="copy from total quantity above">
                  </font>
                  <input name="catalogno" type="hidden" id="catalogno" value="forth">
    Thank you
    Nelson

  • #7
    Regular Coder
    Join Date
    Jul 2002
    Posts
    698
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Like this I think.
    Code:
    <head>
    <script>
      function change()
    	{
    	  var topoption=document.getElementById('toption1');
    		
    		topoption.value='';
    		var tempArr=new Array();
    
    		if(document.getElementById('small').checked)
    		tempArr[tempArr.length]=new Array((parseInt(document.getElementById('s').value,10)==document.getElementById('s').value)?document.getElementById('s').value:0,'Small');
    		
    		if(document.getElementById('medium').checked)
    		tempArr[tempArr.length]=new Array((parseInt(document.getElementById('m').value,10)==document.getElementById('m').value)?document.getElementById('m').value:0,'Medium');
    
    		if(document.getElementById('large').checked)
    		tempArr[tempArr.length]=new Array((parseInt(document.getElementById('l').value,10)==document.getElementById('l').value)?document.getElementById('l').value:0,'Large');
    
    		if(document.getElementById('xlarge').checked)
    		tempArr[tempArr.length]=new Array((parseInt(document.getElementById('xl').value,10)==document.getElementById('xl').value)?document.getElementById('xl').value:0,'XLarge');
    
    		if(document.getElementById('xxlarge').checked)
    		tempArr[tempArr.length]=new Array((parseInt(document.getElementById('xxl').value,10)==document.getElementById('xxl').value)?document.getElementById('xxl').value:0,'XXLarge');
    
    		if(document.getElementById('xxxlarge').checked)
    		tempArr[tempArr.length]=new Array((parseInt(document.getElementById('xxxl').value,10)==document.getElementById('xxxl').value)?document.getElementById('xxxl').value:0,'XXXLarge');
        l=0;
    		for(i=0;i<tempArr.length;i++)
    		{
    		  if((tempArr[i][0]+'').length>l)l=(tempArr[i][0]+'').length;
    		}		
    		d=2;
    		spaces=new Array('',' ','  ','   ','    ','    '); 
    		var total=0;
    		for(i=0;i<tempArr.length;i++)
    		{
    		  topoption.value+=tempArr[i][0]+spaces[d+l-(tempArr[i][0]+'').length]+tempArr[i][1]+'\n\r';
    			total+=parseInt(tempArr[i][0],10);
    		}	
    		document.getElementById('quantity').value=total;
    		document.getElementById('quantity2').value=total;
    		document.getElementById('quantity3').value=total;
    		document.getElementById('quantity4').value=total;
    		document.getElementById('quantity5').value=total;
    	}
    </script>
    </head>
    
    <form method="POST" action="%%script_loc%%">
      <input type="hidden" name="user_action" value="addtocart">
    	<input type="hidden" name="catalogno" value="%%catalogno%%">
    	<input type="hidden" name="multi" value="multi">
    	<input type="hidden" name="add%%catalogno%%" value="YES">
        <font face="Arial"></font>    <table width="100%" border="0" cellspacing="0" cellpadding="5">
          <tr>
            <td colspan="2">Check the boxxes nexxt to the sizes then enter the quantity
              for each size checked</td>
          </tr>
          <tr>
            <td><div align="center"><strong>Size
              <!--The size checkboxx names and the quantity texxtboxx names can be anything. They are for user input to be manipulated and inserted to specific named fields. -->
            </strong></div>
            </td>
            <td><div align="center"><strong>Quantity</strong></div>
            </td>
          </tr>
          <tr>
            <td><input name="small" type=CHECKBOX id="small" value="Small" onclick="change();">      
              Small</td>
            <td><div align="center">
                <input name="s" type=TExxT id="s" size=3 maxxlength=2 onchange="change();">
                <small><font face="Arial">
                </font></small> </div>
            </td>
          </tr>
          <tr>
            <td><input name="medium" type=CHECKBOX id="medium" value="Medium"  onclick="change();">      
              Medium</td>
            <td><div align="center">
                <INPUT NAME="m" TYPE=TExxT id="m" SIZE=3 MAxxLENGTH=2 onchange="change();">
                <small><font face="Arial">
                </font></small> </div>
            </td>
          </tr>
          <tr>
            <td><input name="large" type=CHECKBOX id="large" value="large"  onclick="change();">
          Large</td>
            <td><div align="center">
                <INPUT NAME="l" TYPE=TExxT id="l" SIZE=3 MAxxLENGTH=2 onchange="change();">
                <small><font face="Arial">
                </font></small> </div>
            </td>
          </tr>
          <tr>
            <td><INPUT NAME="xlarge" TYPE=CHECKBOX id="xlarge" VALUE="xLarge"  onclick="change();">
          xLarge</td>
            <td><div align="center">            
              <input name="xl" type=TExxT id="xl" size=3 maxxlength=2 onchange="change();">
              <small><font face="Arial">
                </font></small> </div>
            </td>
          </tr>
          <tr>
            <td nowrap><INPUT NAME="xxlarge" TYPE=CHECKBOX id="xxlarge" VALUE="xxLarge"  onclick="change();">
          xx Large</td>
            <td><div align="center">
                <div align="center">
                  <INPUT NAME="xxl" TYPE=TExxT id="xxl" SIZE=3 MAxxLENGTH=2 onchange="change();">
                  <small><font face="Arial">
                  </font></small> </div>
              </div>
            </td>
            <td><div align="center"> </div>
            </td>
          </tr>
          <tr>
            <td nowrap><INPUT NAME="xxxlarge" TYPE=CHECKBOX id="xxxlarge" VALUE="xxxLarge"  onclick="change();">
          xxx Large</td>
            <td><div align="center">
                <div align="center">
                  <INPUT NAME="xxxl" TYPE=TExxT id="xxxl" SIZE=3 MAxxLENGTH=2 onchange="change();">
                  <small><font face="Arial">
                  </font></small> </div>
              </div>
            </td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td nowrap>Total </td>
            <td><div align="center">
              <!--Must be named quantity. Must be a read only field.  This field needs to dynamiclly add the contents of field s through xxxxxxl.-->
              <input name="quantity" type="text" id="quantity" size="4" readonly="">
            </div></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td colspan="2" nowrap><!--Texxt area below must be named toption1. I want to dynamically compose a texxt list in this texxtboxx based on user selection.
    Exxample:
    3   Small
    4   Medium
    25  Large
    10  xxxxLarge
    Formatting the assembled texxt in a list style is important. -->  
     <textarea name="toption1" cols="40" wrap="VIRTUAL" id="toption1"></textarea></td>
            <td>&nbsp;</td>
          </tr>
        </table>
        <div align="center"><center><table border="0"
          cellpadding="5" cellspacing="0" width="100%">
            <tr>
              <td><p><font face="Arial">            
                <!--All field names below must retain their names and duplicate names.  -->
                <input name="addfirst" type="hidden" id="addfirst" value="YES">
                <input name="quantity" type="hidden" id="quantity2" value="copy from total quantity above">
                <input type="hidden" name="catalogno" value="first">
                <br>
              </font>Add second print?
                  <input
        name="addsecond" type="checkbox" id="addsecond" value="YES">
                  <font face="Arial">
                  <input name="quantity" type="hidden" id="quantity3" value="copy from total quantity above">
                  </font>
                  <input type="hidden" name="catalogno" value="second">
                  <br>
                  Add third print?
                  <input
        name="addsthird" type="checkbox" id="addsthird" value="YES">
                  <font face="Arial">
                  <input name="quantity" type="hidden" id="quantity4" value="copy from total quantity above">
                  </font>
                  <input name="catalogno" type="hidden" id="catalogno" value="third">
                  <br>
                  Add forth print?
                  <input
        name="addforth" type="checkbox" id="addforth" value="YES">
                  <font face="Arial">
                  <input name="quantity" type="hidden" id="quantity5" value="copy from total quantity above">
                  </font>
                  <input name="catalogno" type="hidden" id="catalogno" value="forth">
    </p>
                </td>
            </tr></table>
          </center></div>
        </form>

  • #8
    New Coder
    Join Date
    May 2004
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Perfect:-) Thank you very much

    Would I be stretching this favor with one more small request?

    Here is 1 of 4 groups of checkboxes:
    Code:
    <td valign="middle">
                          <input name="add441" type="checkbox" id="add441" value="YES">                      <input name="quantity" type="hidden" id="quantity1" value=""><input name="catalogno" type="hidden" id="catalogno" value="441"><td valign="middle" nowrap><font size="-1">up to 4&quot; x 4&quot; </font></td>
                        <td valign="middle"><font size="-1"><img src="../../assets/spacer.gif" width="10" height="10"></font></td>
                        <td valign="middle">
                          <input name="add8131" type="checkbox" id="add8131" value="YES">                      <input name="quantity" type="hidden" id="quantity2" value=""><input name="catalogno" type="hidden" id="catalogno" value="8131"><td valign="middle"><font size="-1">up to 8&quot; X 13&quot; </font></td>
                        <td valign="middle"><img src="../../assets/spacer.gif" width="10" height="10"></td>
                        <td rowspan="2" valign="middle"><textarea name="toption2" cols="35" rows="2" id="textarea2"></textarea>
                        </td>
                      </tr>
                      <tr>
                        <td valign="middle"><input name="add481" type="checkbox" id="add481" value="YES"><input name="quantity" type="hidden" id="quantity3" value=""><input name="catalogno" type="hidden" id="catalogno3" value="481"><td valign="middle" nowrap><font size="-1"> up to 4&quot; x 8&quot;</font></td>
                        <td valign="middle"><font size="-1"><img src="../../assets/spacer.gif" width="10" height="10"></font></td>
                        <td valign="middle"><input name="add10161" type="checkbox" id="add10161" value="YES">
                          <input name="quantity" type="hidden" id="quantity4" value="">
                          <input name="catalogno" type="hidden" id="catalogno4" value="10161"></td>
                        <td valign="middle" nowrap><font size="-1">up to 10.5&quot; x
                            16.5&quot;</font></td>
    Here we have a series of 4 checkboxes. Can we limit the user to select only 1 checkbox?

    Thank you

  • #9
    Regular Coder
    Join Date
    Jul 2002
    Posts
    698
    Thanks
    0
    Thanked 0 Times in 0 Posts
    there is an input type called Radio use that, to make a group simple give the input tags the same name.

    <input type="Radio" name="onegroup">
    <input type="Radio" name="onegroup">
    <input type="Radio" name="onegroup">

    <input type="Radio" name="anothergroup">
    <input type="Radio" name="anothergroup">
    <input type="Radio" name="anothergroup">

  • #10
    New Coder
    Join Date
    May 2004
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you, but radio buttons won't work for this project because each checkbox must have a unique name. I did locate a snipplet that will work for this. You have been a great help with the main part of this project and I want to take moment to personally thank you for all you have done

    I do have one last phase to complete with this form. I am almost afraid to ask since you have been such a great help so far, i don't want to ware out my welcome I still need to set up 4 upload links for visitors to upload image files. This can be done either right on the page or in a popup window, but I will want the file name to populate 4 hidden fields in the main form. 4 uploads, each to populate 4 designated hidden fields. Should a visitor change thier mind and upload a different image then the second (or most recent) upload be the one to populate the hidden fields.

    Thank you
    Nelson Quimby

  • #11
    Regular Coder
    Join Date
    Jul 2002
    Posts
    698
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Note the div blok around each segment of input tags is important. the names of the input tags has no influence on the script.
    Code:
    <script>
      function updateFields(aObj){
    	  var tags=aObj.parentNode.getElementsByTagName('input');
    		var file=aObj.value;alert(file.lastIndexOf("\\"));
    	  file=file.substr(file.lastIndexOf("\\")+1,file.length-file.lastIndexOf('\\'));
    		tags[1].value=file;
    		tags[2].value=file;
    		tags[3].value=file;
    		tags[4].value=file;						
    	}
    </script>
    <form>
    <div>
      <input type="File" name="file1" onchange="updateFields(this);" value="">
      <input type="hidden" name="someName" value="">	
      <input type="hidden" name="someName" value="">	
      <input type="hidden" name="someName" value="">	
      <input type="hidden" name="someName" value="">				
    </div>
    <div>
      <input type="File" name="file2" onchange="updateFields(this);" value="">
      <input type="hidden" name="someName" value="">	
      <input type="hidden" name="someName" value="">	
      <input type="hidden" name="someName" value="">	
      <input type="hidden" name="someName" value="">					
    </div>
    <div>
      <input type="File" name="file3" onchange="updateFields(this);" value="">
      <input type="hidden" name="someName" value="">	
      <input type="hidden" name="someName" value="">	
      <input type="hidden" name="someName" value="">	
      <input type="hidden" name="someName" value="">				
    </div>
    <div>
      <input type="File" name="file4" onchange="updateFields(this);" value="">
      <input type="hidden" name="someName" value="">	
      <input type="hidden" name="someName" value="">	
      <input type="hidden" name="someName" value="">	
      <input type="hidden" name="someName" value="">				
    </div>
    </form>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •