Stooney Posted September 19, 2008 Share Posted September 19, 2008 In the following example, how would I send the value of 'organization' in the sndReq() function? Let me know if I'm not clear. <div id="registration"> <input type="text" name="organization"> <input type="button" value="Click" onClick="SndReq('../ajax/invoice_ajax.php?mode=setup&organization=???')"> </div> Edit: sndReq is my ajax function, it is working fine. Quote Link to comment Share on other sites More sharing options...
Stooney Posted September 19, 2008 Author Share Posted September 19, 2008 After lots of trial and error I guess it (I don't know javascript syntax very well yet). <?php echo '<input type="button" value="Submit" onClick="sndReq(\'../ajax/invoice_ajax.php?mode=setup&organization=\'+organization.value)"></td>'; ?> Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted September 19, 2008 Share Posted September 19, 2008 It would be better to give organization and ID attribute an give it the value of 'organization' as well. Then you should do it like so: echo '<input type="button" value="Submit" onClick="sndReq(\'../ajax/invoice_ajax.php?mode=setup&organization=\'+document.getElementById('organization').value)"></td>'; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.