User Profile

Collapse

Profile Sidebar

Collapse
Dracenfels
Dracenfels
Last Activity: Aug 31 '07, 06:15 AM
Joined: Aug 6 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Dracenfels
    replied to I can't validate an array - help
    So would I have to write a var line for each of the possible box variables (possibly upto 10) like this:

    Code:
    var box_value0 = document.getElementById('locbox[0]').value;
    var box_value1 = document.getElementById('locbox[1]').value;
    etc
    ?...
    See more | Go to post

    Leave a comment:


  • Dracenfels
    replied to I can't validate an array - help
    I'm validating the form clientside, hence the javascript, and using the php form to assemble the data and email it....
    See more | Go to post

    Leave a comment:


  • Dracenfels
    replied to I can't validate an array - help
    I don't understand why this is as the php file which runs after validation understands all of the locbox[] values as an array, why can't another script on the first page do this?...
    See more | Go to post

    Leave a comment:


  • Dracenfels
    replied to I can't validate an array - help
    I tried this for the validation;

    Code:
       var total="";
        for(var i=0; i < locbox; i++){
        if(locbox[i].value =="") {
        total +=document.locbox[i].value + "\n";
        }
    	}
        if(total=="") {
        alert("fill something in");
        return false;
        }
    (I've put the whole form here http://www.eds.shed.googlep...
    See more | Go to post

    Leave a comment:


  • Dracenfels
    started a topic I can't validate an array - help

    I can't validate an array - help

    I've pulled together an online form that creates a number of tables dependant on the results of a dropdown list, i.e. 2 from the list creates two input tables, 10 creates 10 tables etc.

    The script for creating the tables is as follows;

    Code:
    <script type="text/javascript"><!--
    	function fboxes(NumberOfBoxes){	
    	var i,boxes='';
    	for(i=0; i<NumberOfBoxes; i++){	
    	boxes += "<table
    ...
    See more | Go to post

  • You're a star, thanks!
    See more | Go to post

    Leave a comment:


  • Dracenfels
    replied to Multiple Text Boxes help
    in PHP
    You have been a great help, thank you. I need to brush up on php and arrays.
    See more | Go to post

    Leave a comment:


  • Dracenfels
    started a topic Defining dynamic javascript variables in PHP
    in PHP

    Defining dynamic javascript variables in PHP

    I have a form with a variable number of text boxes, defined by the user selecting a number from a drop-down list.
    The boxes are created thus:-

    [CODE=javascript]<script type="text/javascript"><!--
    function fboxes(NumberOf Boxes){
    var i,boxes='';
    for(i=0; i<NumberOfBoxes ; i++ ){
    boxes += "<textarea name='textbox["+i+"]' id='textbox["+i+"]'></textarea>";...
    See more | Go to post

  • Dracenfels
    replied to Multiple Text Boxes help
    in PHP
    Fantastic! got it working, thank you very much (that saved me much hair pulling and headaches).
    A further question would be how to reference the text boxes in the form-mailer php script. If I define each box

    $textbox = ($_POST["textbox"]);
    $textbox1 = ($_POST["textbox1"]);
    $textbox2 = ($_POST["textbox2"]);

    I get a result "Array,,,"

    If I use...
    See more | Go to post

    Leave a comment:


  • Dracenfels
    replied to Multiple Text Boxes help
    in PHP
    No good, well this line;

    <select name="boxes" onChange="boxes (this.value)">

    gave internet explorer an error (Object doesn't support this property or method), firefox just didn't do anything.

    Any other ideas?
    See more | Go to post

    Leave a comment:


  • Dracenfels
    replied to Multiple Text Boxes help
    in PHP
    I tried this;

    <html>
    <head>


    </head>


    <body>

    <select name="boxes" onChange="boxes ()">
    <option value="">choose </option>
    <option value="1">1</option>
    <option value="2">2</option>
    </select>
    <script type="text/javascript">...
    See more | Go to post

    Leave a comment:


  • Dracenfels
    started a topic Multiple Text Boxes help
    in PHP

    Multiple Text Boxes help

    I need to write a form that asks the usser to define the number of problems (this is simply from a dropdown menu), depending on the number they select they will be asked for a definition of each problem in a seperate text box (one text box for each problem). So if they pick 2 as the number of problem they will be given two text boxes, 5 boxes for selecting 5 from the drop down list.
    I think I need some javascript (for form validation), some...
    See more | Go to post
No activity results to display
Show More
Working...