Jump to content

[SOLVED] Drop down form - option syntax


Thundarfoot

Recommended Posts

here is what I have(which obviously does not work lol)

 

<form id="form1" name="form1" method="post" action="">
  <label>Files
  <select name="select">
<option value="http://localhost/file1.php">File 1</option>
<option value="http://localhost/file2.php">File 2</option>
  </select>
  </label>
  <input type="submit" name="submit" value="submit">

 

Basically I think my option value is wrong...

any help is much appreciated.

Link to comment
https://forums.phpfreaks.com/topic/89331-solved-drop-down-form-option-syntax/
Share on other sites

You need to submit the form using javscript

 

 

<script language="javascript">

function submits(form1){

val=form1.sel.value

form1.action = val;

form1.submit();

}

</script>

 

call the above funcion on click of the submit button and change the buttons inpu type to button from type=submit

 

 

Rgds

Sharad

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.