Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Textbox disabled does not send value to database

Tags:

php

mysql

I have a text box which picks up a value from my database and is a read only text box. it contains some information which i want to send to my datbase but nothing is being recorded. Once the textbox isnt a read only, the data is successfully stored. Is there any way i can keep my textbox disabled and still send the data to my database?

<form action="refnoadded.php?public=<?php echo $id; ?>" method="post">        
    <span id="sprytextfield1">
        <input type="text" name="ref"  value="<?php echo $newpass ?>" disabled />    
        <input type="button" onClick="history.go(0)" value = "Generate Reference">
        <br />
        <span class="textfieldRequiredMsg">Reference Number Required</span>
    </span>        
    <br />
    <input type="submit" value="Add Reference" />
</form>

any ideas?

like image 877
Jahed Hussain Avatar asked Nov 19 '25 02:11

Jahed Hussain


1 Answers

disabled doesn't send data to server

use

<input readonly value="my value" name="myname">

HTH!


Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!