New to this but have made my way through many things but now I am stumped: I have a php page that does numerous things with a couple different form area’s. In one form area I pull a list of records from a database and display them in a select window. After the selection has been made by clicking on it, I want the NEXT button to be Enabled and not before. I have tried so many things I am back at square 1
THE BUTTON
<form name= "Next_Button_Form" method="post" action="EditRecordPage.php">
Choose The Correct Item and Click :
<input type="submit" id="nextbutton" name="nextbutton" value="NEXT" ></strong>
</form>
Simple enough if it is in the same form space but the select is in one form space and the submit is in another due to the need to do other things before and after in the form - I think I got it covered with //<input type="submit" id="nextbutton" value="NEXT" <?php if ($enablenextbutton == ''){ ?> disabled <?php } ?> > and setting //$enabalenextbutton="Yes" while the select sequence runs.
Only issue now is it only works once and disables my SELECT from selecting a different item which wasn’t the case before adding the php if
Grrr - it took my Code sample out when I replied - lets try this again - This works to enable the Next after SELECT is done and //$enablenextbutton="Yes" is set during SELECT process //<input type="submit" id="nextbutton" value="NEXT" <?php if ($enablenextbutton == ''){ ?> disabled <?php } ?> >
The issue is that the SELECT won’t allow me to CHANGE the Selected item now but before just adding the php in my submit it did
To do what I was trying to do which is enable and disable a button in a different form on the same page after SELECTING and item from a MYSQL query select list you do this:
The SUBMIT BUTTON //<input type="submit" id="nextbutton" value="NEXT" <?php if ($enablenextbutton == ''){ ?> disabled <?php } ?> >
It he SELECT FUNCTION $enablenextbutton = “Yes”;
SO if you use one action to get the list and then another action to SELECT FROM IT - the NEXT will not be enabled until you have SELECTED something
That sounds like a JavaScript problem. JavaScript deals more with user interface on the page. PHP is really more for data processing and heavy backend stuff.
Also, when formatting code on this forum, you can either click on the </> icon above in the editor and place your codes inside what the editor gives.