Jump to content

newman

Members
  • Posts

    28
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

newman's Achievements

Member

Member (2/5)

0

Reputation

  1. newman

    arrays

    hi , how are you doing? i have a question : <form name="MyForm" method="GET" action="submit.php"> <input type="text" name="name" value="tom"> <input type="checkbox" name="goods[]" value="1"> <input type="checkbox" name="goods[]" value="2"> <input type="checkbox" name="goods[]" value="3"> <input type="checkbox" name="goods[]" value="4"> <input type="button" onclick="MyFunction(this.form.name.value)"> </form> you see i can send the Name value to my function but how can i send the checkboxes values to this function like the name field? by the way the number of checboxes are not defined . i tried "this.form.goods[].value" and "this.form.goods.value" but i got an error . how can i do it ? thanks in advance ...
  2. Hi all . i have a form en i wanna pass its values to a JS function .reading a text element value is easy but i can not read the radio button value. how can i do that ? [code] <form name="MyForm" method="GET"> <input type="text" name="fname"> <input type="radio" name="gender" value="m">Male <input type="radio" name="gender" value="f">Female <input type="button" value="SendToFunction" onclick="MyFunction(this.form.fname.value,[ How can read gender value ??? ])"> </form> [/code]
  3. god bless you ,i dont know why you dont explain it with an example . i'm not a pro . i tried this :  document.MyForm.friends.length but i got an error .
  4. thanks . but how can i count this elements . how to know how many fields i have ? in here how many fields named friends[] . thanks again
  5. sorry , i asked my question badly. i meat the values of elements. like PHP we pass an array to a function : [code] $friends=array('tom','rich','nick'); MyFunction($friends); [/code] now i wanna do it in JS . i have these fields values: [code]<input type="text" name="friends[]" value="tom"> <input type="text" name="friends[]" value="rich"> <input type="text" name="friends[]" value="nick">[/code] how can I pass these values to a JS function as a parameter.
  6. hi everybody . i'm wonderin' if there's any way to pass HTML array fields to a JS function as a parameter . suppose i have 3 HTML fields : <input type="text" name="friends[]" value="tom"> <input type="text" name="friends[]" value="richard"> <input type="text" name="friends[]" value="nick"> now i wanna pass these 3 elements to a JS function . i tried MyFunction(friends[]) but i got an error . can any one help me . thank you before hand .
  7. thanks for the replies . i tested what akitchin said : <select name="addr[0]"> <option value="1"> <option value="2"> <option value="3"> </select> <select name="addr[1]"> <option value="4"> <option value="5"> <option value="6"> </select> but i get an array like this . the last option of each select element: Array ( [0] => 3 [1] => 6 )
  8. hi . i have an array of multiple select elements : <select multiple name="addr[]"> <option value=1>first choice <option value=2>second choice <option value=3>third choice </select> <select multiple name="addr[]"> <option value=1>first choice <option value=2>second choice <option value=3>third choice </select> i want these two to be in 2 different indexes : \[0\]=1 \[0\]=2 \[0\]=3 [1]=1 [1]=2 [1]=3 but it creates an array like this : [0]=1 [1]=2 [2]=3 [3]=1 [4]=2 [5]=3 what's the solution to have an array like the one above ? thanks in advance .
  9. hi all . i've got a problem with cookies . when i add www in my URL the cookies do not work . 1 ) http://mydomain.com ( cookies work ) 2 ) http://www.mydomain.com ( cookies do not work ) have anyone had this problem ? thanks in advance .
  10. i wanna do something like movabletype or other content management systems . whenever user sends a post . it pings weblogs.com or blogrolling to let others know this site has been updated .
  11. would u please explain more?
  12. hi there . how can i ping blogrolling when i insert a record into my database ? thanks
  13. thanks for your answer . but i want to remove only the style=".." not other attributes , and some table cells have 0,1,2 or 3 lines of css like this : <td style="border:#000000 1px; background-color:#ffffff; padding:3px">something</td> or <td style="border:#000000 1px; background-color:#ffffff;">something</td> or <td style="border:#000000 1px">something</td>
  14. hi . how can i remove the style attribute and its contents ( the code blow ) using preg_replace , as u can see the style"...." is in 3 lines: <td style="background-color:#ffffff; border:#0000001px;padding:3px; font-style:italic"></td> the code would turn to : <td></td> after replacing how can i do that ? thanks .
×
×
  • 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.