Lads again my JS knowledge is letting me down in AJAX.
My ajax is returning the code
This function can be seen here:Code:addPubNum( 5940, '1796 Wolfe Tone Bar' , 'pubid1' );
The problem is that this function/code isn't populating the form:Code:function addPubNum( id, name, pubnum ) {document.forms['addpub'].elements[ pubnum ][ document.forms['addpub'].elements[ pubnum].length ] = new Option( name, id );}
Code:<table width="100%"> <form name="addpub" action="userpage.php" method="GET"> <tr><td colspan="2">Please Enter Your 1st Pub</td></tr> <tr><td><select name="countyid" onChange="showPubNum(1,this.value);"><option value="0">Select County</option> <option value="1">Antrim</option> <option value="2">Armagh</option> </select></td> <td><select name="pubid1"><option value=""></option></select> </td></tr> <tr><td colspan="2" align="right"><input type="submit" value="Add"></td></tr> </form></table>
If anyone could see an error off the top of their head that would be great!
P.S. -> showPubNum(1,this.value); is working fine!


LinkBack URL
About LinkBacks










Reply With Quote

