Jump to content

christiana

Members
  • Posts

    4
  • Joined

  • Last visited

christiana's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. well i now have the same id and name and i have chenged that also in fuction,but it still doesnt work.[] arent problem as far as attribute name is concerned,they worked perfectly fine..but no change makes this function work!!!!any thoughts?thanks!
  2. well as i have made my application it is necessary to have [].but i didnt know that the name and the id should be the same!!i'll try it...hoping it will work..!thanks for your help!
  3. i tried that but it still doesnt work!!!i cant understand what is the problem...my selects are as follows <select name="mySelect[0]" id="select1"> (they are filled with values from database..)can you find the mistake?it just doesnt work!i also try calling the function from a button and not an input type of submit,that is <button onClick="checkUniquePrefs();">Save</button>but it stil..doesnt work!!!
  4. Hello all!i am having troubles with my javascript function!what i want to do,is to check if user selects more than one same items in my 3 select lists...my code is as follows:function checkUniquePrefs() { var list = document.getElementById("select1") var name = list.options[list.selectedIndex].text var list2 = document.getElementById("select2") var name2 = list2.options[list2.selectedIndex].text var list3 = document.getElementById("select3") var name3 = list3.options[list3.selectedIndex].text var test = document.getElementById("myform") if (name != name2 && name != name3 && name2 != name3) { test.submit(); } else { return false; } }and i call the function as follows: <input type="submit" value="Save" onClick="checkUniquePrefs()"/>what goes wrong?sometimes i think that the code doesnt run at all..what is wrong with my code??any help appreciated!!!!!
×
×
  • Create New...