Javascript (with Sharepoint 2007) alert -
i program java started programming javascript , searched , searched couldn't find works. problem there 4 input fields (parid, groups, customer , projectname) , wanted add values make large string e.g.: 123456_nec_franzi_seestadt every time try alert it keeps me saying "undefined"
<p> par id: <input id = "parid"> </p> <p> research group: <select id = "groups"> <option></option> <option>bam</option> <option>pas</option> <option>avt</option> <option>sra</option> <option>nec</option> <option>itp</option> <option>eld</option> <option>rft</option> <option>see</option> </select> </p> <p> customer: <input id = "customer"> </p> <p> projectname: <input id = "projectname"> </p> <p> submit: <input id = "submit" type = "button" value = "submit" onclick = "output()"> </p> <script> function output() { var w, text; // alert ("did work?"); document.getelementbyid("parid").value = w; if (w != null) { alert(w); } } </script>
document.getelementbyid("parid").value = w;
should be
w = document.getelementbyid("parid").value;
the variable assignment wrong way round. logical error, nothing specific javascript.
p.s. if want combine values of different fields, can use + operator concatenate them single string.
Comments
Post a Comment