Welcome to the Monastery | |
PerlMonks |
Re^4: Passing perl variable as input name?by RobRobson (Novice) |
on Jul 22, 2016 at 10:04 UTC ( [id://1168339]=note: print w/replies, xml ) | Need Help?? |
Hi NetWallah,
Really appreciate this! I have adjusted the input as suggested but still no luck. I am currently pulling the parameter like this as previously suggested: my $selectedName = param($unit_name);Here is the current state of my while loop which is able to dynamically create buttons on the page but when clicking on them the page simply refreshes and no parameters are sent through:
Here are my current URL paramters: ViewUnits.pl?unit_name=Air+Con+1&Air+Con+1.x=68&Air+Con+1.y=24&unit_name=Air+Con+2&unit_name=Air+Con+3&unit_name=Air+Con+4&unit_name=Air+Con+5&unit_name=Air+Con+6&unit_name=Air+Con+7&unit_name=Air+Con+8&unit_name=Air+Con+9When putting the hidden input field after the while loop, the URL parameters will always equal "Air Con 9" yet the value still does not display when attempting to print: print "<br>Name: $selectedName<br>";If you need anything else from me or have any other suggestions please let me know. I will continue to research and update if I am able to find a solution! UPDATE: After playing around with the cgi I have found when setting: $selectedName = param('unit_name'); This links to the hidden input field, button clicks now make the selectedName variable equal "Air Con 1" regardless of which button is pressed. Still not creating the names as expected but at least I am passing a value now.
In Section
Seekers of Perl Wisdom
|
|