Jump to content

Repgahroll

Members
  • Posts

    13
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Repgahroll's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hello there. (sorry my english) I have a php form that has several fields named in sequence, for example: phone1, phone2, phone3... this is what i need to get these fields via $_post method. The problem is, the fields should have a mask (the same mask, for example ###-####). And i'm using Javascriptools2 to do this. However, i don't want to use a javascript "for" statement because it slows down some browsers on old systems and the compatibility is bad also. So i wonder if there's another way to do this using some other parameter of the field, like the 'class' or something that can be unique and applied to all fields. Thanks in advance.
  2. Hello. I need a function that gets inputs values by fields IDs and join them on a hidden field. Something like: function text() { document.form.hidden.value = document.form.elements['one'].value+document.form.elements['two'].value; } inputs: <input type="hidden" name="hidden"> <input type="text" id="one"> <input type="text" id="two"> In this case the value of hidden field should be the values of (id)one plus (id)two. However, the above code only work on ONE browser, and i want a little bit more compatibility. I think the right way to do is using getElementById, but i don't know how to make it work. Thank you in advance.
  3. Hello. I'm making a "dynamic" form using php and javascript to hide/show simple text inputs. However, if i add more than (approx.) 180 inputs, the form simply does not submit, it just returns to the same page, like a reload. If i decrease the number of inputs to something like 150, everything works. I can add as many unnamed fields as i want without problems. So i think it's PHP fault. I'm using the "post" method to transfer the vars to another file that check the fields and store'me on db. Thanks in advance.
  4. Hello. I'm a beginner php programmer and have this simple form: name:[____] phone1:[____] phone2:[____] phone3:[____] Everything is inside a div, and there are 4 more identical divs. my problem is, them all are displayed simultaneously, and i want to have the following: name:[____] [add phone] [add person] when the user click "add phone" button, an input appears, when the user click "add person" button, another div appears (that has another "add phone" button inside). One problem is, i'm using two scripts, one to hide/show the input, another to hide/show the div. And another problem is, these fields will be populated using data from db, and when some field has any value != "", it should be shown. However, i know nothing about javascript (i'm learning php) and couldn't find any specific tutorial that teaches how to hide/show different things using the same script and how to get values from fields in a div and use them in the script. So please, anyone, point me on the right direction, i don't need the specific answer, i just need a tutorial/documentation that teaches how to program cross-browser javascript to do this. All the documentation that i found was pretty old, and teaches to program distinct javascripts, one that works for IE, and another that works for Netscape. Thank you very much.
  5. Hello there! I have the following list: apple,banana,pear|applejuice,bananajuice,pearjuice|applepie,bananapie,pearpie I can explode these to get: array[0] = apple,banana,pear array[1] = applejuice,bananajuice,pearjuice array[2] = applepie,bananapie,pearpie However, i want to get: array[0][0] = apple array[0][1] = banana array[0][2] = pear ... But i don't know how i can explode these items inside the array to get such result. Thanks in advance.
  6. Hello there. I'm learning Joomla, and the following lines works well to store "myvar" on database. <input type="text" name="myvar" value="<?php echo $myvar ?>"/> <?php $this->user->myvar = $myvar; ?> However, i want to store more than one input, so i wonder if it's possible to do something using javascript. For example <input type="text" name="myvara" value=""/> <input type="text" name="myvarb" value=""/> --some way to concatenate "on the fly" myvara+","+myvarb into myvar-- --some way to make it readable for php as "myvar" on input name above-- <?php $this->user->myvar = $myvar; ?> Thanks in advance.
  7. Hello. I'm making a simple modification on drupal, and there will be a option to choose the pets the user has, pretty simple though, there will be a button "add new pet" and then the options "type" (dog/cat/hamster/parrot...), "name", and "age". However, this is endless... when the user click on "add new pet" another button appears, and they can add as many pets as they want. So i think it's better to store these informations in lists, a list for 'type', a list for 'name' and etc. However, I don't know how to store a list in a MySQL db. And access it later. Can you help me? Thanks in advance.
  8. here's another version that I made: <?php $loop = 1; foreach(glob("*.dae") as $fileandext){ $filename = explode(".", $fileandext); echo "<a href=\"$filename[0].dae\"><image src=\"$filename[0].jpg\"></a><br />"; $loop++; } ?> Thanks mjdamato for pointing me on the right direction .
  9. Hello. I want to have a "repository" for 3d models, however, i want it as simple as possible. My idea is to simply upload the files and their respective pictures to a folder and have a php script that will list them and display it properly automatically. For example, when i have a new chair model, i simply upload the files chair.jpg and chair.dae(3d model) to the folder furniture, when someone runs the script (by acessing the page) it reads everything in the folder, and define every *.jpg as a var, then it prints the var.jpg(as image) and var.dae(as link) in a table. Can someone help me to do this? I just need the part that declares vars for every file. Thank you in advance.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.