Jump to content

[SOLVED] Input text value


Stooney

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/124904-solved-input-text-value/
Share on other sites

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>';
?>

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>';

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.